In developing a strategy I have a strange behaviur in a certain point of ema and sma.
I can't find the problem also using debug so I post the file with the strategy fault and a picture and debug info when fault occur.
I verify the error comparing the chart and the value from ema and sma function.
In the debug file you can see:
Sma =3,23340740740741 ema= 3,29517788702776 Close = 3,456 PROBLEM: should be (measured from the chart): ema= 3,45 Sma= 3,40
Sma =3,25089655172414 ema= 3,31540181975563 Close = 3,402 PROBLEM: should be (measured from the chart): ema= 3,44 Sma= 3,445
I use yahoo data and Intesa as stock. The first error happens on 7/08/2015.
All other value before is ok.
Thanks in advance
Comment