Integrate ATR stop with Darvas Box
Author: RodrigoAcioli
Creation Date: 1/11/2021 1:57 AM
profile picture

RodrigoAcioli

#1
I would like help to modify the output in the Darvas Box setup, using the ATR STOP. I got this cod from this site, but did not get the implementation.

Thank you for your help!
profile picture

Eugene

#2
Taking the code from here: How to Integrate CooledOff into the Darvas System, it may be something like:

CODE:
Please log in to see this code.
profile picture

RodrigoAcioli

#3
Hello Eugene, unfortunately I was unable to finalize the cod so that the stop is triggered when prices reach the ATR.
profile picture

Eugene

#4
Since your reply isn't very helpful to understand the issue, perhaps you might want to revisit some C# references from this FAQ: How do I start with C# ? It should pay off if you provide a more detailed problem description.
profile picture

RodrigoAcioli

#5
Hi Eugene, my goal is in the attached image, stop when the price touches the ART Stop. And you can't implement with the cod you sent.

Thank you very much for your attention!
profile picture

Eugene

#6
My sample code above shows a generic ATR trailing stop that only moves if the price moves favorably. You can change that to SellAtStop if you like.
profile picture

RodrigoAcioli

#7
Eugene, sorry for the inconvenience, but I really don't have much coding skills, I'm still studying. But I would like to use the "ATR trailing stop", my stop would be: Exit through Darvas Box or ATR trailing stop. My chart is in accordance with the attached image (Exits only through the Darvas Box, Error when assembling the boxes).

Thank you for your patience!

CODE:
Please log in to see this code.
profile picture

Eugene

#8
Rodrigo, it's a pretty simple change:
CODE:
Please log in to see this code.


Please from now on start using CODE tags - they exist on the forum for a reason. See how nice your code looks now after I wrapped it inside the CODE tags?

P.S. Never put PlotSeries inside a loop - it's not meant to be plotted Bars times:

//PlotSeries(PricePane, (Close - ATR.Series(Bars, 14) * 3) >> 1, Color.Red, LineStyle.Solid, 1);
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).