How to configure zigzag as stop loss
I have a renko trading system that looks very good, but I need to set my stops at the previous ZigZag high/low. I notice this indi isn’t available in ea wizard. Mark please can you help me with how I can write this in ea wizard?
you can add any custom indicator to EA Wizard, including ZigZag.
The only issue is that ZigZag indicator returns value only on the bar on which it makes the top or bottom, so you need a way to recognize it and retrieve the right value.
This is quite tricky, it is difficult to do it in pure EA Wizard, as it requires using a cycle.
It can be made using a little of MQL code and custom function.
Thanks for your help. I managed to import zigzag custom indi to EA wizard successfully. I think I understand what you’re saying that I need to retrieve the right value.
But when I look at custom indi list and load zigzag, the only specs it has under parameter is shift (refer to image), so look at this second image – I would like it to enter a sell trade based on certain conditions and place stop at the zigzag high marked as the white horizontal line – This is obviously where it stops because price has made a high and is now pulling down.
So how could I tell the indicator it is zigzag high shift 1 or low shift 1?
Your help is appreciated,
unfortunately it is neither. If you’ll check for which values ZigZag returns in MT4 Data window you’ll see that most bars it doesn’t return any value. It returns value only if there is peak or bottom.
So you can use function like IndicatorHighestValue(ZigZag(…), X) to get the peak of ZigZag in the last X candles,
or IndicatorLowestValue(ZigZag(…), X) to get ZigZag bottom value.
You can then use these values as your SL or PT.
Also another way of doing it is by getting a programmer to modify the standard metatrader zigzag indicator so that when you import the custom indicator into strategyquant you can select either the last zigzag high or low. You can also use the addition / subtraction feature in strategyquant to make your stop loss x pips (variable) above / below the last swing high / low. I use the last zigzag high / low as my stop loss with good results. If you need a programmer to do this, just contact me through my website and I will put you in contact with them.
Viewing 5 posts - 1 through 5 (of 5 total)