help needed with Zigzag Open long and open short conditions

 

Hi,

I’ve only just starting learning some of the very basics of MQL5 so please forgive me if I’m using the wrong terms to explain my problem, I’ll do my best to explain.

I’m trying to create an EA with which includes the “ZigzagColor.mq5” indicator using “EA builder”,.

I took a guess that when the zigzag color variable changes, it may return a “0”.

I wrote a condition that opens a long position “zigzag colorbuffer is equal to 0”, this condition seemed to open a long position correctly at the moment the Zigzag changed color to start longward.

Then I tried to write the short condition.

To open a short position I tried “zigzag indicator colorbuffer is equal to 1”  as well as other options, but this does not open a short position at the correct time of the color change.

I’ve attached the indicator I’m using hoping someone can look at it and tell me where I’m going wrong.

What is the condition needed to open a “Short” position when the zigzag changes color to go short?

 Is there a better go about writing conditions to open short and open  long, than using the color buffer? I did also try using the HighMapBuffer LowMapBuffer ZigzagPeakBuffer ZigzagLawnBuffer but still no luck, I've obviously using the wrong method.

Cheers

Dash

 

If you want to learn how to work with the MQL5 language - NEVER use all kinds of " builder ". Always write on your own or study examples.


Example of advisors based on "ZigzagColor":

 

I suggest first to investigate how the values in the indicator buffers of the ZigZagColor indicator change.

(This is a 99% ready-made expert - so far I have removed a block of trading signals from it, instead of trading signals, the expert displays values from indicator buffers on the screen)


Files:
 
Vladimir Karputov:

I suggest first to investigate how the values in the indicator buffers of the ZigZagColor indicator change.

(This is a 99% ready-made expert - so far I have removed a block of trading signals from it, instead of trading signals, the expert displays values from indicator buffers on the screen)


I understand what you're saying Vladimir. I started playing with the EA builder before even thinking about learning MQl5, as MQL5 looked too daunting to undertake for someone without a coding background. I won't speak badly about EA builder, as It has been handy to test basic theories quickly, and has taught me a few things. But as you use it more , you also realize its limitations.  Sometimes you realize how just smallest bit of mql5 code you could have learned yourself, would make your EA do exactly what you want, not near enough. But I soon realized, if I'm going to be building EA's in  long term, the sooner I learn MQL5 the better off I will be.  It will be a slow journey, but I have started. 

Thanks for the links, I'll check them out. I can see from your EA already that I misunderstood how the color buffer worked. Cheers.

 
Dashoshea: I’m trying to create an EA … using “EA builder”,.
EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, FOREXEADVISOR STRATEGY BUILDER, FX EA Builder, fxDreema, FxPro, Molanis, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
  1. Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
    If we tell you what you need, you can't code it.
    If we give you the code, you don't know how to integrate it into yours.
    We are willing to HELP you when you post your attempt (using SRC) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

  2. EA builder makes bad code counting up while closing multiple orders.
    EA builder makes bad code Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
    EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
    EA builder makes bad code, not adjusting for ECN brokers. pre-Build 500)
    EA builder makes bad code, not checking return codes.

  3. EATree uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)

  4. FX EA Builder makes bad code, not checking return codes.
    FX EA Builder makes bad code, loosing open tickets on terminal restart. No recovery (crash/power failure.)
    FX EA Builder makes bad code, not adjusting stops for the spread.
    FX EA Builder makes bad code, using OrdersTotal directly.

  5. FOREXEADVISOR STRATEGY BUILDER makes bad code, non-updateing global variables.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, compilation errors.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, not checking return codes.

Learn to code it, or pay someone (Freelance) someone to code it.
          Hiring to write script - General - MQL5 programming forum #1 2019.08.21

 
Agreed! Tried a EA builder in my past and got a complete unreadable code from it. Worthless.  Besides Vladimir, how can we get the right signals from only the color change?
 
Traders use to look for supply and denand zones, then support and resistance and blend it with an indicator signal, so  it's just the start.
Reason: