I want to know when will zerodha add super trend indicator in pi software

I have no idea. But yeah why don't you borrow my Caps Lock?

7 Likes

I asked about the Supertrend formula in this forum, and someone helped me with that. Based on that data, I have managed to create a Supertrend EA in Tradescript, and using it in Pi. But I am still waiting for the day when Supertrend will be a new indicator in Zerodha Pi.

Thanks very much for the code

what exactly is a super trend ?

I COPIED AND PASTED THIS CODE…BUT AM ENCOUNTERING AN ERROR…" ENTER IN CORRECT FORMATE"…CAN ANY BODY HELP ME …WHAT TO PASTE IN BUY SCRIPT AND SELL SCRIPT.?

hi abhijit,

we need to paste the buy code in buy text boc and sell code in the sell, but where to paste the values which you have pasted at last?

thanx

regards

can you please post the Supertrend indicator code

This is the EA setup that I use for Supertrend:
SET A = TR()
SET B = SMA(REF(A,1),13)
SET C = (B13 + A)/14
SET ST1 = (HIGH + LOW)/2 + 3
C
SET ST2 = (HIGH + LOW)/2 - 3*C
SET MA1 = EMA(CLOSE,10)
SET MA2 = SMA(CLOSE,50)
SET R = RSI(CLOSE,9)
SET ST = IF(TREND(CLOSE)=UP,ST1,ST2)
Buy signal: CLOSE>MA2 AND MA1>ST AND TREND(ST)=UP AND R<70
Sell signal: CLOSE<MA2 AND MA1<ST AND TREND(ST)=DOWN AND R>30
People can change some parameters according to their convenience. I use the ones that I found the most profitable in backtests( based on 15 min and 1 hour charts). Please also note that this EA gives trade signals a little late, not at the point of trend reversal. Use it only for FNO, not currency trading.

I modified this code, so I will paste the modified code here. For buy paste this: CLOSE>MA2 AND MA1>ST AND TREND(ST)=UP AND R<70 and for sell paste this:CLOSE<MA2 AND MA1<ST AND TREND(ST)=DOWN AND R>30. I did not get any errors in Pi. Please check if you pasted the correct code. I will paste the modified code soon.

Please use this Supertrend code:
SET A = 1
SET A = LOOP(A,1,1,0,ADD)
SET B = LOOP(ATR,A,1,1,MULTIPLY)
SET ATR = LOOP(B,TR(),0,0,ADD)/A
SET ATR14 = IF(A=14,ATR,0)
SET ST1 = (HIGH + LOW)/2 + 3ATR14
SET ST2 = (HIGH + LOW)/2 - 3
ATR14
SET MA1 = EMA(CLOSE,10)
SET MA2 = SMA(CLOSE,50)
SET R = RSI(CLOSE,10)
SET ST = IF(TREND(CLOSE)=UP,ST1,ST2)
BUY: CLOSE>MA2 AND CLOSE>ST AND MA1>ST AND TREND(ST)=UP AND R<70
SELL: CLOSE<MA2 AND CLOSE<ST AND MA1<ST AND TREND(ST)=DOWN AND R>30

I TIRED DOING THIS BUT NOT WORKING BROTHER IS THERE IS another WAY OUT.