When I run backtest, I seem to be getting different results for a particular MA for a given time than what I see on the chart. I figure I am doing something wrong, but I can not pinpoint what.
Heres an example of what I mean:
formula output:
thisBar_MA: 81.08624999999992 day: 4 time 12:05
thisBar_MA: 81.09874999999992 day: 4 time 12:0
thisBar_MA: 81.10874999999993 day: 4 time 11:55
Heres the part of my code that generates the output:
var study1 = new MAStudy(8, 0, "C", "MAStudy.EXPONENTIAL");
function main(){
var thisBar = study1.getValue(MAStudy.MA);
debugPrint("\nthisBar_MA: "+thisBar+" day: "+getDay()+" time "+getHour()+":"+getMinute()); ...
And finally I am attacking the chart for that time period with the chart's MA. Any help would be appreciated!
Heres an example of what I mean:
formula output:
thisBar_MA: 81.08624999999992 day: 4 time 12:05
thisBar_MA: 81.09874999999992 day: 4 time 12:0
thisBar_MA: 81.10874999999993 day: 4 time 11:55
Heres the part of my code that generates the output:
var study1 = new MAStudy(8, 0, "C", "MAStudy.EXPONENTIAL");
function main(){
var thisBar = study1.getValue(MAStudy.MA);
debugPrint("\nthisBar_MA: "+thisBar+" day: "+getDay()+" time "+getHour()+":"+getMinute()); ...
And finally I am attacking the chart for that time period with the chart's MA. Any help would be appreciated!
Comment