Enabling an EA to open multiple orders

 

Hello all,

I have a little trouble figuring out how to "link" the EA's multiple orders.

Since I have zero coding skills, I am using FxPro Quant to help visually outline the EA's functions and then I implement small corrections directly in the generated code.

So far, so good.

The EAs are working fine and nice.


BUT


I cannot figure out how to link the following app switch:


To a simple True/False switch in the EA input variables like this:

input bool _If_No_Orders = false;                       // If No Orders


I have reviewed the code generated with the two different values from the app switch and the only difference is as follows:

FALSE (multiple orders allowed)
        if ( false && true )

TRUE (single orders allowed)
        if ( false && !__isExist( 0, Symbol()) )


Can any kind soul direct me to a simple solution?

Much kudos

 
WildCard578: Since I have zero coding skills, I am using FxPro Quant
  1. Why are you not asking them how to use their product?

  2. EA builder, fxDreema, EATree, FxPro Quant, 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 to the language up front, and then just wrote it.
    • 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 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.
    • EA builder makes bad code counting up while closing multiple orders.
      EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
      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.
      EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
 

I now realize that I haven't explained why I can't figure it out and what my solution would be.


What puzzles me is that the first piece of code, which declares the following:

if( false && true )

does not seem correlated to anything in the code.

I mean, there is no spefication of WHAT could be true or false so ANYTHING could apply.

Or am I wrong?


On the other hand, the second piece of code is a bit better:

if( false && !__isExist( 0, Symbol()) )

stating the logical negation of the existence of an order, but it still has that false condition that I cannot understand.


Perhaps the easiest solution would be to replace it with:

if ( _Multiple_Orders_Activation = true )

and

if ( _Multiple_Orders_Activation = false && !__isExist( 0, Symbol()) )

In the first line we disregard altogether the check for existing orders, allowing the EA to open as many positions as the indicator triggers.

In the second we check for existing orders to limit the EA to only one order at a time.


Seems a proper solution to me, please correct me if I made the wrong assumptions or have overlooked something important.

Thank you.

 
WildCard578:

I now realize that I haven't explained why I can't figure it out and what my solution would be.

What puzzles me is that the first piece of code, which declares the following:.......................................


You aren't coding this mess, you are using a code generator.

You can learn MQL by reading the links below, or you can hire someone to help you.

Documentation

https://www.mql5.com/en/docs

CodeBase for examples

https://www.mql5.com/en/code

Articles

https://www.mql5.com/en/articles


There are numerous programmers who are willing to help you in the freelance section.

https://www.mql5.com/en/job




Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Hi, actually there are 3 MAs that are being needed, but only two ones are important for the core functionality, the third one is just to be turned on / off to filter out. So what I want is a signal that occurs, when the Fast MA has merged a certain distance from the Slow MA, plus has not come back to it too close* for a certain time-period (for...