Comment on Managing your Script

Varesh commented on 04 Oct 2013, 03:08 AM

Hi Zerodha,

I have tried below strategy which are throwing above mentioned error.

When 14 period ADX is above 25
MacD with 26,13,6 values shows a buy/sell crossover respectively, and then the move is confirmed by below criteria to open a buy/sell position respectively
Stock retraces at least 3 days from up/down trend (It can be between 3 and 5 days retracement) and then to take buy/sell position respectively when the price
goes above/below previous days High/low respectively
The ADX should be above 25 and rising from lower levels and not falling from higher levels.

Buy Expression:
CLOSE > REF(HIGH,1) AND ADX(14) > 25 AND REF(ADX(14),1) < 25 AND MACD(26,12,9,EXPONENTIAL) > 0 AND CLOSE < REF(CLOSE,-1) AND REF(CLOSE,-1) < REF(CLOSE,-2)
AND REF(CLOSE,-2) < REF(CLOSE,-3)
Buy exit: 0

Sell Expression:
CLOSE < REF(LOW,1) AND ADX(14) > 25 AND REF(ADX(14),1) < 25 AND MACD(26,12,9,EXPONENTIAL) < 0 AND CLOSE > REF(CLOSE,-1) AND REF(CLOSE,-1) > REF(CLOSE,-2)
AND REF(CLOSE,-2) > REF(CLOSE,-3)
Sell exit: 0

View the full comment thread »