I know I have posted about this before, and I thought I solved this problem, but I am home sick and enjoying the luxury of watching E-Sig, and taking notes.
Here is my dilemma . . .
Take two studies I declare in an EFS as:
var study5 = new MAStudy(5,0,"OHLC/4","Simple");
var study6 = new MAStudy(10,0,"OHLC/4","Simple");
When I run my script in a backtested mode, I am fully aware how to get the right values to use and correlate them back to the chart:
myMA_FAST = study5.getValue(MAStudy.MA);
myMA_SLOW = study6.getValue(MAStudy.MA);
The problem is when I am running the EFS in a live manner, while watching the market, I can never seem to feed the EFS the correct closing values for the bar.
In my EFS, on the first tick of a new bar, I grab the last recalled value from the previous bar, and I assume that it should be the closing value of the previous bar. Thinking that the last tick is truly the last tick, and must be equal to one reading made on the final O/H/L/C. However, this is just not the case.
Can some tell me how to recall the proper final closing value of a moving average in this case, from the first tick of a new bar, but using the proper O/H/L/C from the previous bar????
As always, I appreciate the help of all in this forum.
Thomas
Here is my dilemma . . .
Take two studies I declare in an EFS as:
var study5 = new MAStudy(5,0,"OHLC/4","Simple");
var study6 = new MAStudy(10,0,"OHLC/4","Simple");
When I run my script in a backtested mode, I am fully aware how to get the right values to use and correlate them back to the chart:
myMA_FAST = study5.getValue(MAStudy.MA);
myMA_SLOW = study6.getValue(MAStudy.MA);
The problem is when I am running the EFS in a live manner, while watching the market, I can never seem to feed the EFS the correct closing values for the bar.
In my EFS, on the first tick of a new bar, I grab the last recalled value from the previous bar, and I assume that it should be the closing value of the previous bar. Thinking that the last tick is truly the last tick, and must be equal to one reading made on the final O/H/L/C. However, this is just not the case.
Can some tell me how to recall the proper final closing value of a moving average in this case, from the first tick of a new bar, but using the proper O/H/L/C from the previous bar????
As always, I appreciate the help of all in this forum.
Thomas
Comment