Normal atr trailingstop
Forums › ProRealTime English forum › ProOrder support › Normal atr trailingstop
- This topic has 42 replies, 5 voices, and was last updated 2 years ago by Franro.
Tagged: atr, atr trailing stop, graph, GRAPHONPRICE, stop, trailing, trailing stop
-
-
04/12/2022 at 7:46 PM #191655
just a quick question is ATR trailingstop affected by current price of market?
If you have for example atr trailing long = 10
Does the market price affect the trailing to start? If market is @ 1000 will the atr move differently if the market was at @ 3000?
04/12/2022 at 7:53 PM #191656atr trail12345678910111213141516171819202122232425262728293031323334353637383940414243ONCE trailingStopType = 1ONCE trailingstoplong = 10ONCE trailingstopshort = 6ONCE atrtrailingperiod = 100ONCE minstop = 1atrtrail = AverageTrueRange[atrtrailingperiod]((close/10)*pipsize)/1000trailingstartl = round(atrtrail*trailingstoplong)trailingstartS = round(atrtrail*trailingstopshort)if trailingStopType = 1 THENTGL =trailingstartlTGS=trailingstartsif not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenif MAXPRICE-tradeprice(1)>=MINSTOP thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeELSEPREZZOUSCITA = MAXPRICE - MINSTOP*pointsizeENDIFENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenif tradeprice(1)-MINPRICE>=MINSTOP thenPREZZOUSCITA = MINPRICE+TGS*pointsizeELSEPREZZOUSCITA = MINPRICE + MINSTOP*pointsizeENDIFENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIFENDIFThis is what I mean with “normal”
04/12/2022 at 7:59 PM #19165704/12/2022 at 8:06 PM #191658Yes, I understsand that TS would kick in after 10 points movement. But is it easier for the TS to start @ 1000 or does the distance work the same way and its not affected by marketprice?
How do you mean?
For an example an index has went from 10000 to 20000 in 3 years but it has went expotential so most of the data is @ 10000, and almost nothing at 20000 but it is where we are right now.
That is why I am wondering if it does matter, because if 10 points ATR is working differntly at 20000 compared to 10000 the TS would not kick as easy? Or do it work the same that is what I am wondering.
04/12/2022 at 8:30 PM #19165904/12/2022 at 8:41 PM #191660I still dont get it how that would tell me if atr is working differntly? You dont seem to understand what I mean? I want to know if ONCE trailingstoplong = 10 works and move ts the same way if the market is @ 1000 or @2000 or @10000 is it affected by marketprice at all?
04/12/2022 at 9:03 PM #191661move ts the same way
You would have to define what you mean by … the same way??
If an ATR of 10 is used with a price of 1000, then this will be bigger range candles (relative to price) than an ATR of 10 with a price of 10,000.
A TS step of 10 with price = 1000 will move in bigger steps (relative to price) than a TS with step of 10 with price = 10000.
If you add ‘GRAPH TGL’ to your code then you will see the TS move on a Chart
04/12/2022 at 9:20 PM #191662Ok thanks alot. So the step will be bigger but the start is the same?
Another example. 1. market is @ 1000, current latent gain is arround 300 euro (usually arround this ts starts) and that is when ts starts becase atr has moved 10 steps
2. market is @ 3000, current latent gain is also arround 300 euro (usually when ts started at @1000), will atr move the same way and start trailing as it would if it was on @1000. Or does the latent gain have to be much higher as the price has moved up or does it not matter at all, for example does the latent gain have to go 700 euro for the atr to move 10?04/13/2022 at 8:16 AM #19167004/13/2022 at 8:52 AM #191673I think plotting ATR on the chart should help spotting any value at any time.
1 user thanked author for this post.
04/13/2022 at 10:05 AM #191676Yes that would solve it BUT
I have tried plotting ATR on the chart like that with 100 in periods from this “ONCE atrtrailingperiod = 100″But a distance of 10 ( ONCE trailingstoplong = 10) is never shown. The max distance 200 units on 1 hour chart is arround 5, BUT TS has kicked in with 10 points on thoose 200 units when using the system. This means the plotting is totally wrong and I can not seem to find out what I am doing it wrongly by plotting it? I am right clicking the chart + add indicator and I choose Averge true range (atr) then I choose nbr of periods 100.
How can I plot the actual TS ATR?
04/13/2022 at 12:56 PM #19168404/13/2022 at 1:04 PM #19168704/14/2022 at 7:25 AM #191740I know and understand that the trailcode is working. I just want to be able to see the distance in ATR. How can I do that?
By plotting “GRAPH PREZZOUSCITA” I can see when the trail starts, but I want to see the actual ATR values
04/14/2022 at 7:41 AM #191742And also it would be nice for someone could answer my question. Let me try to explain it further…
For example on the attached picture from XBTUSD.
In the red box its the period of arround 2018 to 2020. The price was much lower in the red box as in the bluebox. If I would like to use the trailingstop code above.. Would for example ONCE trailingstoplong = 10. Work the same as in the blue box as the red box.
Lets say that most of the trades in the red box the trialingstop was kicked in when the price of the current position was arround 300 euro for the most cases (not all).
Would the same algo with same trailingstoplong = 10 still kick in the trailingstop arround 300 euro in the blue box also. Or as the price has gone much higher up in the blue box would it automaticly change that current latent gain has to be much higher than it was back when the price was lower?
I hope I made it much clearer now.
-
AuthorPosts
Find exclusive trading pro-tools on