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
Yes, thanks, all fixed, no errors. It slows down, yes, very much. Would you advise which direction to go to optimize it or will you have to rewrite everything?
Too many objects are created and deleted on every tick, it should be limited in some way, for example, not all objects are deleted, but only those drawn on the last 1-2 bars.
For example, in similar case I used such function instead ofObjectsDeleteAll() in start():
{
for(int i=ObjectsTotal()-1;i>=0;i--)
{
string name=ObjectName(i);
if(StringFind(name,"Shadows.",0)>-1)
{
datetime crtm=(datetime)ObjectGetInteger(0,name,OBJPROP_CREATETIME);
if(crtm>=iTime(Symbol(),0,1))
if(!ObjectDelete(name)) Print("ObjectDelete error# ",_LastError);
}
}
}
Could you tell me if it is possible to manage the trading permission for this EA from the EA?
i.e. to use MQL_TRADE_ALLOWED variable ?
For example if spread is large, then prohibit trade (but not to stop expert advisor)
I just don't know how to set this variable. Direct assignment of 1 or 0 does not work.Could you tell me if it is possible to manage the trading permission for this EA from the EA?
i.e. to use MQL_TRADE_ALLOWED variable ?
For example, if spread is large, then prohibit trade (but not to stop the EA)
I just don't know how to set this variable. I can't set it directly to 1 or 0.This state
https://www.mql5.com/ru/docs/runtime/tradepermission
But it is possible to control it.
You just have to make a program algorithm.
At any point in the algorithm and under any condition, you can exit the program with the command
Hello! I am new to this difficult business and am constantly facing new obstacles. I am trying to write an EA, but I cannot solve the problem with the timeframe of the indicator that my EA uses to enter. The essence of the problem is the following: According to the conditions, I need that on the 15-minute time frame on the indicator Stochasstic Signal line was below the level of 20. Exactly at 15 min. TF! In fact, it turns out that the signal line crosses the level 20 in other timeframes (1; 5; 30 min.) and my Expert Advisor works falsely. I need to filter out all of the timeframes, and only leave the 15 min. That EA has not considered crossovers on other TFs. I would appreciate your help.
Show me a code fragment on how you read the signal from the indicator in your Expert Advisor
But it is possible to control it.
You just have to make a program algorithm.
At any point in the algorithm and under any condition, you can exit the program with the command
then the program will stop executing, but I need it to continue.
I guess I'd have to make a bunch of conditions.
then the program will stop executing, but I need it to continue
I guess I'll have to make a bunch of conditions.
What can we continue if the spread has gone up? If you have to continue, what does spread have to do with it?
(c)then prohibit trading (but not stop the EA)= If you prohibit trading, how will it continue to work? What is the point?
then the program will stop executing, but I need it to continue
I guess I'll have to make a bunch of conditions.
That's right, it's a program.)