may i have some help on this indicator, i want to make it strategy
Forums › ProRealTime English forum › ProOrder support › may i have some help on this indicator, i want to make it strategy
- This topic has 8 replies, 5 voices, and was last updated 4 months ago by JS.
-
-
06/26/2024 at 10:48 PM #234392
xatr = averagetruerange[c](close)
nLoss = a * xatrif heikin then
src = (open+close+high+low)/4
else
src = close
endifif barindex < c then
xatrTrailingStop = undefined
pos = 0
else
if src > xatrTrailingStop[1] and src[1] > xatrTrailingStop[1] then
xAtrTrailingStop = max(xatrTrailingStop[1],src-nLoss)
else
if src < xatrTrailingStop[1] and src[1] < xatrTrailingStop[1] then
xAtrTrailingStop = min(xatrTrailingStop[1],src+nLoss)
else
if src > xatrTrailingStop[1] then
xAtrTrailingStop = src-nLoss
else
xAtrTrailingStop = src+nLoss
endif
endif
endifif src[1] < xatrTrailingStop[1] and src > xAtrTrailingStop[1] then
pos = 1
r=250
g=0
b=0
else
if src[1] > xatrTrailingStop[1] and src < xatrTrailingStop[1] then
pos = -1
r=0
g=0
b=250
else
pos = pos[1]
endif
endif
endif///////Trading conditions
ema = average[1](src)
above = ema crosses over xatrTrailingStop
below = ema crosses under xatrTrailingStopbuy1 = src > xatrTrailingStop and above
sell1 = src < xatrTrailingStop and belowbarbuy = src > xatrTrailingStop
barsell = src < xatrTrailingStop//////Plot signals and candles
if drawsignals then
if buy1 then
drawarrowup(barindex,low-0.15*averagetruerange[10])coloured(“green”)
elsif sell1 then
drawarrowdown(barindex,high+0.15*averagetruerange[10])coloured(“red”)
endif
endifif colorcandles then
if barbuy then
rbar=0
gbar=250
bbar=0
elsif barsell then
rbar=250
gbar=0
bbar=0
else
rbar=125
gbar=125
bbar=125
endif
DRAWCANDLE(open, high, low, close)coloured(rbar,gbar,bbar)
endif
return xatrTrailingStop as “Trailing Stop” coloured(r,g,b)style(line,2)06/27/2024 at 8:19 AM #234414Hi. Next time you share a code please define all variables (a, c, heikin, etc)
Here you have the code:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768a=2c=100heikin=1xatr = averagetruerange[c](close)nLoss = a * xatrif heikin thensrc = (open+close+high+low)/4elsesrc = closeendifif barindex < c thenxatrTrailingStop = undefinedpos = 0elseif src > xatrTrailingStop[1] and src[1] > xatrTrailingStop[1] thenxAtrTrailingStop = max(xatrTrailingStop[1],src-nLoss)elseif src < xatrTrailingStop[1] and src[1] < xatrTrailingStop[1] thenxAtrTrailingStop = min(xatrTrailingStop[1],src+nLoss)elseif src > xatrTrailingStop[1] thenxAtrTrailingStop = src-nLosselsexAtrTrailingStop = src+nLossendifendifendifif src[1] < xatrTrailingStop[1] and src > xAtrTrailingStop[1] thenpos = 1r=250g=0b=0elseif src[1] > xatrTrailingStop[1] and src < xatrTrailingStop[1] thenpos = -1r=0g=0b=250elsepos = pos[1]endifendifendif///////Trading conditionsema = average[1](src)above = ema crosses over xatrTrailingStopbelow = ema crosses under xatrTrailingStopbuy1 = src > xatrTrailingStop and abovesell1 = src < xatrTrailingStop and belowbarbuy = src > xatrTrailingStopbarsell = src < xatrTrailingStop//////Plot signals and candlesif buy1 thenbuy 1 contract at marketendifif sell1 thensellshort 1 contract at marketendif06/27/2024 at 12:29 PM #23442606/27/2024 at 2:51 PM #23443306/28/2024 at 10:51 AM #234475هل يمكنك جعله فعالا على مؤشر ناسداك في فترة 5 دقائق والتوافق مع حركة الشموع في استراتيجية تنبيهات UT bot؟Can you make it effective on Nasdaq in 5 minutes period and match the candle movement in UT bot alerts strategy?
06/28/2024 at 12:11 PM #23448706/29/2024 at 10:51 AM #234525Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thanks 🙂
07/01/2024 at 2:51 PM #23465307/01/2024 at 3:03 PM #234658 -
AuthorPosts
Find exclusive trading pro-tools on