Please change Pinescript code to Gekko Strategy.
#1
Hello. I am very new to the gekko.
I have Tradingview pinescript code but I am poor at javascript.
Can someone change below code to Gekko strategy?
Thank you.
--------------------------------------------------------------
//@version=2
study(title="MODIFIED ADX", shorttitle="MODIFIED ADX", overlay=true)
//
//VAR
lenadx = 14 //DI Length
lensig = 14 //ADX Smoothing
limadx = 18 //ADX Green Active

//CACULATION
up = high - high[1] //ORIGINAL : up = change(high)
down = low[1] - low //ORIGINAL : down = -change(low)
trur = rma(max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1]))), lenadx)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, lenadx) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, lenadx) / trur)
sum = plus + minus
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

macol = adx > limadx and plus > minus ? lime : adx > limadx and plus < minus ? red :black
//
//BUY OR SELL
buy = macol != black and ((macol == lime and macol[1] == red) or (macol == lime and macol[1] == black)) ? true : na
sell = macol != black and ((macol == red and macol[1] == lime) or (macol == red and macol[1] == black)) ? true : na
//END
  Reply


Forum Jump:


Users browsing this thread: