Questions from Beginners MQL5 MT5 MetaTrader 5 - page 973

 
Sprut112:
Can you use this variant of lot calculation in percents, replacing MarketInfo of course?
It is convenient because it takes into account the symbol at which it is calculated, because eurusd lot and eurnzd lot are two big differences. i want to know how to write it for mt5 and whether it is possible
OP_LOTS =NormalizeDouble(AccountInfoDouble(ACCOUNT_BALANCE)* _LosPercent / 100 /SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE)/(pp),dg);

If you want it to be tool-dependent, replaceSymbol()

to a string variable that contains the desired tool symbol...

According to your code, it's

symbol_name[ii]


 
xxz:

If you want it to be tool-dependent, replaceSymbol()

to a string variable that contains the desired tool symbol...

According to your code this is


Yes, thanks, it's very similar. For my strategy, it's important that weights of currencies coincide
 
I'm having trouble rebooting my Windows 8 computer. The terminals are working. Once a day I restart the computer via the job scheduler with shutdown.exe -r -t 10 -f . The autostart works but unfortunately the start of the terminal advisers (before rebooting) does not start with 100% probability. Please advise how to close and restart several terminals so that the EAs are always loaded ?
 
pivomoe:
I have a problem with my computer rebooting on Windows 8. The terminals are working. Once a day I restart the computer via the job scheduler with shutdown.exe -r -t 10 -f . The autostart works but unfortunately the start of the terminal advisers (before rebooting) does not start with 100% probability. Please advise how to close and restart several terminals so that the EAs are always loaded ?

Fix the initialisation blocks in the EA (OnInit() ).

 

Good afternoon. Please help me to find an EA that will give signals to the mail when a level is crossed based on stochastic. Sam in programming nil. Thanks in advance!

 
xxz:

If you want it to be tool-dependent, replaceSymbol()

to a string variable that contains the desired tool symbol...

According to your code it's


It seems to me here that the minimum lot is 0.1, while we need 0.01. Maybe the second line should have dg=2?

 if(SymbolInfoDouble(Symb,SYMBOL_VOLUME_STEP)<0.1) dg=2; else
      if(SymbolInfoDouble(Symb,SYMBOL_VOLUME_STEP)<1.0) dg=1;
   
 
JimmyJonce:

Good afternoon. Please help me to find an EA that will give signals to the mail when a level is crossed based on stochastic. Sam in programming nil. Thanks in advance!

Search KodoBase for the words"Stochastic" or"Stochastic".

 
Sprut112:

Here it seems to me that the minimum lot is 0.1, and you need 0.01. Maybe in the second line dg=2?

You don't have to compare anything, just find Step and use it, preferably in OnInit() it is the same for a particular account, as a rule it doesn't change from pair to pair...

double Step=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_STEP);
 
xxz:

you don't have to compare anything, just find Step and use it, and preferably in OnInit() it's the same for a particular account, as a rule it doesn't change from pair to pair...

Can you do it this way?

 input_lots = NormalizeDouble(AccountInfoDouble(ACCOUNT_MARGIN_FREE)* MaximumRisk / 100 /SymbolInfoDouble(symbol_name[ir],SYMBOL_TRADE_TICK_VALUE)/1000,dg); 
 input_lots = MathRound(input_lots / SymbolInfoDouble(symbol_name[ir] , SYMBOL_VOLUME_STEP)) * SymbolInfoDouble(symbol_name[ir], SYMBOL_VOLUME_STEP);
      
 
Sprut112:

Can I do that?

You can...

I think it's better.

MathFloor
just doesn't make sense...
Reason: