Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Stop using the value of an indicator on previous bar
I'm trying to find a suitable way of coding a stoploss or trailstop that follows price, using an indicator in an auto strategy.
The indicator I favour is the ZerolagHATEMA.
For example, I've tried:
SetTrailStop(CalculationMode.Ticks, ZeroLagHATEMA(Period).ZeroHATEMA[1]);
I use the Period variable set to 5 so it closely follows price, but it doesn't seem to work when I place it before or after CalculateOnBarClose = true; and protected override void OnBarUpdate() - the latter after the buy/sell signals
I prefer to use the MedianRenko4 bar chart.
My coding skills are not too flash therefore if anyone has any ideas I'd love to hear them.
I have to jump on a plane to New Zealand for a family wedding in a few hours so now off to bed (Brisbane time is +15hrs US EST) - so apologies in advance for not responding for a few days until I return early next week
Cheers,
Nano
Can you help answer these questions from other members on NexusFi?
Sorry mate, I have moved on after discovering Hurley auto strategy trading. Check out the coding in The Elite Circle/Elite Group Trading Methods/The Hurley Method (automated) - some of Big Mikes and my trailing stoploss methods may be useful.
Trail Stop should be in ticks, as in ticks away from current price. In the first example from nano, you are trailing the entire value of that indicator. For CL example, if price is 85.00 and the indicator value is 84.20, you are trailing not 80 ticks but 8420 ticks.