Discussion of article "Library for easy and quick development of MetaTrader programs (part XXII): Trading classes - Base trading class, verification of limitations" - page 2
So after event processing, at the end of the event type check module, what do you have in the last_event variable? That's what you need to reset in the EA. And not forcibly call the method of resetting the last event of the library - the library itself calls it right after sending the event to the chart and writing it to the list of events.
Yes. I just missed and didn't put one line at the end.
Artyom Trishkin: You can just equate it to TRADE_EVENT_NO_EVENT.
It's not working. It prints on every tick. The order is activated on the fifth tick, it prints "1" 4 times in the log and then it prints "20" on every tick.
//--- If the last trade event has changedif(engine.LastTradeEvent() != last_event)
{
last_event=engine.LastTradeEvent();
switch(last_event)
{
case TRADE_EVENT_PENDING_ORDER_PLASED :
Print(__FUNCTION__, "***", last_event);
break;
case TRADE_EVENT_PENDING_ORDER_REMOVED :
break;
case TRADE_EVENT_PENDING_ORDER_ACTIVATED :
{
Print(__FUNCTION__, "***", last_event);
//OrderActivated();break;
}
case TRADE_EVENT_POSITION_OPENED :
break;
case TRADE_EVENT_POSITION_CLOSED :
break;
//---default :
break;
}
last_event = TRADE_EVENT_NO_EVENT;
}
It's not working. It prints on every tick. The order is activated on the fifth tick, it prints "1" 4 times in the log and then it prints "20" on each tick.
We need to see what you have created there. It works in test Expert Advisors.
I'm on my mobile. I'll be there in about five hours.
Artyom Trishkin: We need to see what you've done. It's working in the test advisors.
I'm on my mobile. I won't be there for another five hours.
I haven't written anything yet. Above the code in the previous post is just this.
//--- Initialisation of the last trade eventstatic ENUM_TRADE_EVENT last_event = WRONG_VALUE;
//--- If working in the testerif(MQLInfoInteger(MQL_TESTER))
{
engine.OnTimer();
}
And below the code, opening two orders OP_SELLLIMIT and OP_SELLSTOP
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
So after event processing, at the end of the event type check module, what do you have in the last_event variable? That's what you need to reset in the EA. And not forcibly call the method of resetting the last event of the library - the library itself calls it right after sending the event to the chart and writing it to the list of events.
Yes. I just missed and didn't put one line at the end.
Yeah. I just missed one line at the end.
You can just equate it to TRADE_EVENT_NO_EVENT.
It's not working. It prints on every tick. The order is activated on the fifth tick, it prints "1" 4 times in the log and then it prints "20" on every tick.
It's not working. It prints on every tick. The order is activated on the fifth tick, it prints "1" 4 times in the log and then it prints "20" on each tick.
We need to see what you've done. It's working in the test advisors.
I haven't written anything yet. Above the code in the previous post is just this.
And below the code, opening two orders OP_SELLLIMIT and OP_SELLSTOPI haven't created anything yet. Above the code in the previous message is only this.
And below the code, opening two orders OP_SELLLIMIT and OP_SELLSTOP.I need to see the whole code. Throw it in a private message, or here if it's not a secret behind seven seals.
There's nothing there yet.
Well, there's nothing there yet
I have to run your code to get an answer. I'll be there, I'll get back to you.
I know you're not home and I'm not rushing you.
I know you're not home and I'm not rushing you.