Experts: Crossing of two iMA - page 3

 

thanks for such a nice EA, I read the code and couldn't understand which part (if any) limits the total number of positions to open. can you please tell me which part to look into?

I'm referring to the code for v2

 
Armin # :
thanks for such a nice EA, I read the code and couldn't understand which part (if any) limits the total number of positions to open. can you please tell me which part to look into?

There is no such limitation.

 
Vladimir Karputov #:

There is no such limitation.

thanks, so it will open one position on each bar until reaches not enough money?


//check volume before OrderSend to avoid "not enough money" error (CTrade)
   
if(chek_volime_lot!=0.0)

if I want to put such limitation, where do you suggest to add it?

 
Armin # :

thanks, so it will open one position on each bar until reaches not enough money?


if I want to put such limitation, where do you suggest to add it?

No. It will not be able to open at every bar - since the trading signal is -> this is the intersection of indicators.

 
Vladimir Karputov #:

No. It will not be able to open at every bar - since the trading signal is -> this is the intersection of indicators.

thank you so much.

the thing I noticed is a situation that during one of my tests happens, so I start with 200, and money management is set to true with lot size 0.01, the EA is in profit but due to many positions open the margin level is reached and it stops out even though it's in profit, here's the photo:

this is why I want to put a limit on the number of positions to open, what to do you suggest on this? check margin level before each order to be more than a certain value? because I checked and there are 26 open positions of 0.01 and margin level is just over 50%


 
Armin # :

thank you so much.

the thing I noticed is a situation that during one of my tests happens, so I start with 200, and money management is set to true with lot size 0.01, the EA is in profit but due to many positions open the margin level is reached and it stops out even though it's in profit, here's the photo:

this is why I want to put a limit on the number of positions to open, what to do you suggest on this? check margin level before each order to be more than a certain value? because I checked and there are 26 open positions of 0.01 and margin level is just over 50%


I propose to rewrite all this to the trading engine version 4.XXXX (article Почти конструктор для создания советника ). In the new engine, you can always allow only one position.

Почти конструктор для создания советника
Почти конструктор для создания советника
  • www.mql5.com
Предлагаю свой набор торговых функций в виде готового советника. Представленный способ позволяет получать множество торговых стратегий простым добавлением индикаторов и изменением входных параметров.
Reason: