Forums › ProRealTime English forum › ProOrder support › Define the current price of my open position › Reply To: Define the current price of my open position
03/17/2019 at 12:08 AM
#93878
e.g. initial stop at the bottom of the previous candle (simple to set). The price moves up, touching the first Fibo extension (138%), I want to move my stop to the open price, to eliminate the trading risk. The price moves again up, touching the second extension (161%) and I want to move my stop to the first Fibo extension (138%) and so on…
Hi @barbagio,
have you been able to code this trailing stop; I coded this but it does not work in IG; the trailing Stop il not following the levels of Fibo ;-( do you have any clue why?
Hi Nicolas,
do you have a hint for this ?
Cheers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
if not ONMARKET then Buy positionSize CONTRACTS AT Market TrailStop = fibo0 - div endif if LONGONMARKET then if close > fibo236 then TrailStop = fibo0 endif if close > fibo236 and close < fibo382 then TrailStop = fibo236 endif if close > fibo382 and close < fibo500 then TrailStop = fibo382 endif if close > fibo500 and close < fibo618 then TrailStop = fibo500 endif if close > fibo618 and close < fibo764 then TrailStop = fibo618 endif if close > fibo764 and close < fibo100 then TrailStop = fibo618 endif if close > fibo100 then SELL AT MARKET endif SELL at TrailStop stop endif |