i would really like to help but i dont understand what you are trying to accomplish, (when you want to buy and when to sell) can u explain the thing with words & not with code (the best would be whit a chart attach)
BTW (according to your code) it seems to me that the array in not necessary at all
one more thing, i think that your conditions can't ever be together "LastBarHigh < SwingValue[0] && Ask > SwingValue[0]"
& the same thing "LastBarLow > SwingValue[0] && Bid < SwingValue[0]" can't be
Wow, I guess I've never even thought about changing the builder code... I'll work on that today :) Also, I'll always try to post labeled charts with every question I have; I really appreciate everyone's help and I want to make it as easy as possible for you all, so I can actually make some progress as a coder.
For now, what I'm trying to do is get the last two ZigZag values, use those to form a breakout range, and trade the breakout of that range (but only when intraday volatility is high).
That's basically what I want to do. Anyway, like I said I'll get to work on building a from-scratch code for this. And I'll learn to make functions and stuff :)
qjol, thanks for the input on the order conditions and array usage... what would you recommend doing instead?
-Alex
double SwingValue[2]={0,0}; while(Found <= 2){ if(iCustom(NULL, 0, "ZigZag", Depth, 5, 3, 0, k) != 0){ SwingValue[Found] = iFound could be 0, 1, or 2 therefor the size of SwingValue must be 3. Your exceeding the array bounds.
Thanks for responding WHRoeder, and my original post reflects your suggestion - I changed the array settings. Unfortunately, still no trades are being opened. Here's another screenshot, during visual mode of the strategy tester, exactly when a short trade should have been taken. The log corresponds with the chart: the ZigZag breakout range is being accurately displayed with the code -- so it must be a problem with the order conditions, right?
I apologize for being obscure in my original post; I hope this is as clear as possible. All I'm looking for is a set of buy and sell conditions that would do the job I'm trying to do. Thanks again for your contributions.
because LastBarLow not > SwingValue[2]

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey everyone,
I recently got an answer to a problem I was having while trying to make an EA based on ZigZag breakouts. Looks like I got the ZigZag code working (don't worry, I realize that ZigZag repaints...), but now the EA isn't trading. I looked in the log, and the values are being displayed correctly, so I figure it must be a problem with my order conditions. Here are my variables:
...and my trading signals:
...and the code to place actual trades is the generic one from the expert advisor builder tool.
The full logic of the EA is only slightly more complicated, and can be found in the attachment. Does anyone know why this might not be trading? Again, I'm getting the correct ZigZag values, but no trades are placed and no errors are shown.
Thanks again for all your help, forum-goers... someday, I hope to be able to answer others' questions and not just post my own!
-Alex