![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
put everything I highlighted into the OnTick() function
Can you explain the difference?
You switch the programme on and it only calculates when you switch it on, and then it does not calculate or recalculate anything, even in the tester
Well, that's a bad start...
You were correctly told above - how to do
You switch the programme on and it only calculates when you switch it on, and then it doesn't calculate or recalculate anything
Such a bad start... You have been told above how to do it correctly
And because of that, trades may not open either. Right?
100%
The tester still does not open trades. I will try it on a demo account. Thanks for the tip.
It will be the same on the demo, just longer.
If you want to share, publish the code
It will be the same on the demo, just longer.
If you want to work together, publish the code
The code is on page 58. Thanks for your help.
You may not have understood exactly what you were told to do.
For example - move the first couple of lines
double Lots;//Определение общего количества лотов
....................
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
Margin_Percent=AccountFreeMargin()*Percent/100;
Lots=Margin_Percent/MarketInfo(Symbol(),MODE_MARGINREQUIRED);
.........
//------
}
You may not have understood exactly what you were told to do.
For example - move the first couple of lines
double Lots;//Определение общего количества лотов
....................
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
Margin_Percent=AccountFreeMargin()*Percent/100;
Lots=Margin_Percent/MarketInfo(Symbol(),MODE_MARGINREQUIRED);
.........
//------
}
Yes. I've moved it all together with the data types. Thank you for telling me how to do it.