Comment on EA's for auto buy/sell signals - Pi

Manu commented on 20 Sep 2015, 12:25 PM

Hi,
I am trying to back test strategy , it gives the backtest result but the chart is blank and the backtesting screen also hangs. When I try to close the chart window it says “chart is in use”. Please correct my code if it has some mistakes. I am testing on 1 minute nifty futures for 1 day data.
For Buy
SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
SET MACDHIST = MACD(12,26, 9, EXPONENTIAL) – MACDSIGNAL(12, 26, 9, EXPONENTIAL)
HAC > MAXOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4)) AND ((MACDHIST>0 AND REF(MACDHIST,1)0 AND REF(MACDHIST,2)<0))
For SELL:
SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
SET MACDHIST = MACD(12,26, 9, EXPONENTIAL) – MACDSIGNAL(12, 26, 9, EXPONENTIAL)
HAC < MINOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4)) AND ((MACDHIST0) OR (REF(MACDHIST,1)0))
The problem seems to be with REF(MACDHIST,2) as when I remove this term it works fine but I require it for my signal generation.
Thanks

View the full comment thread »