Martingale over all pairs
-
Hello! I would like to use the martingale option over all pairs the EA is attached.
Example:
- Trade: EURUSD 1 Lot Buy --> closed in loss
- Trade: USDJPY 2 Lot Sell --> closed in loss
.... and so on.
I think this is not possible with the martingale option in Buy/Sell block?
Thank you very much.
-
You can create a variable that will determine lot size, then use the block "check profit (last closed)" to modify the variable based on the outcome of the last trade. Modify to lot*2 if loss, and back to initial lot size if profit. You can then use the same lot size variable to buy/sell both EURUSD and USDJPY (you can choose the symbol and lot size within the buy/sell block)
Search the forum for "martingale" and you'll find a tutorial on how to handle custom configurations..
-
Thank you very much. So it is by design that the martingale Option in BUY/SELL block only works for the same pair?
Should i use something like this: http://fxdreema.com/forum/topic/5937/tutorial-custom-martingale-1 ?
There are one more problem:
On a new account with no trades: how can i use „check profit (last closed)?
Thank you!
-
I would make another variable (:D) that just counts the trades opened. Then you could put first condition like "tradecount == 0" -> if true, use default settings,
-> if false, "check profit" etc. -
Good idea. Thank you very much.
Do someone has a solution how to prevent 2 or more trades at the same time with many pairs, if every EA has „no trade“ block?
-
But how can I solve the problem of increasing lot size at different pairs?
EURUSD —> 1 Lot —> SL
USDJPY —> 2 Lot —> SL (this will work)
GBPUSD —> 4 Lot (how can this ES „know“ that there has to be 4 and not only 2 Lot?)Thank you.
-
In summary: the stop loss in ANY pair must modify the variable that defines lot size for all pairs.
- Create a variable called "LotSize"
- Use block "modify variable" to change LotSize to LotSize*2 every time a position in any pair is closed by SL (use the pink blocks)
- Use another "modify variable" block to change LotSize to initial lot size every time a position in any pair is closed by TP (use the pink blocks)
- Use the same LotSize variable to define lot size in the Buy/Sell blocks you're using for each pair.
Of course there are details that may be specific to your trading logic.... but the logic is above.
-
Thank you very much. But i think i could use global variables instead, too?
-
In the same EA, Martingale works for the same pair, yes. You can have let's say one Buy and one Sell blocks (or more than two blocks, it doesn't matter) working on the same pair, and those blocks will work "together". Basically, before going to create a new trade, the lot size is calculated from the previously closed trade with the same Symbol and magic number (or Group #). So if you have another block for another Symbol, then it works on a different Martingale... instance.
-
@fxDreema
Thank you very much.What do you mean with "So if you have another block for another Symbol, then it works on a different Martingale"?