
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
In Combat Advisors, I've wrapped functions everywhere in suspicious places to _B(FuncName(...), AlertTime).
Forgot that it's very expensive.
At best I spend tens of milliseconds on each tick just because of HistorySelect.
Profiling the combat advisor.
Why use expensive HS at all, except when starting the robot?
Wrote at the beginning of the thread.
You make an OrderSend. If, immediately after the end of the OrderSend, a certain position has not closed at the same time, you make another OrderSend. This is all the logic you need to program. Async is not used.
Now the situation that happened for our robot. You have sent an OrderSend and while it is being executed the Limiter has triggered and then the TP of our position has been executed, as I mentioned earlier.
I really don't understand anything about this - if you can, please describe the steps in more detail. The only thing I got was that only theOnTradeTransaction event handler is used, which means that we don't need event handling priority management and the suggested
bool HandleNextEvent(ENUM_EVENT_TYPE);
degenerates into
bool HandleNextEvent();
This is where I really don't get it - if you can, please describe it in more detail step by step.
Why can't youreturn after callingOrderSend?
Next time you return to OnMain when a new event has already been added to the queue (or by timer)
A100:
Why can't theOrderSend call be followed bya return ?
There is no limitation.
Next time you return to OnMain when a new event is added to the queue (or by timer)
The next event is the execution of a pending order and not of a take position.
The next event is the execution of the pending order, not the takeover of the position.
It is suggested to return repeatedly, until you either read the whole current queue or for a given number of events. When trade events are over - there will be a timer return and you will have access to all events at once