Features of the mql5 language, subtleties and tricks - page 17

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
Why do you need it if you can not see it anyway?
You don't have to set these parameters if you don't want to display the indicator.
And compatibility with the old code will not be broken. During testing, the indicator is always displayed.
Because you cannot set the display properties (the drawing part) through the indicator handle (through the calculation part). A bug is when something is written in one way, but works in another way.
A different approach is needed here. Access to the indicator by short name, as in the ChartIndicatorXXX function group. Something like ChartIndicatorSetInteger(chart_id,sub_window,indicator_name,PROP_COLOR,mod,value)
We already thought about it, but have not got around to it yet.
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5 language, tips and tricks
fxsaber, 2017.02.25 16:02
{
if ((Result.deal == 0) && (Result.order != 0))
{
if (::HistorySelectByPosition(::HistoryOrderGetInteger(Result.order, ORDER_POSITION_ID)))
for (int i = ::HistoryDealsTotal() - 1; i >= 0; i--)
{
const ulong DealTicket = ::HistoryDealGetTicket(i);
if (Result.order == ::HistoryDealGetInteger(DealTicket, DEAL_ORDER))
{
Result.deal = DealTicket;
break;
}
}
}
return(::HistoryDealSelect(Result.deal));
}
// Учтены MT5-нюансы: Result.deal == 0
static bool OrderSendSync( const MqlTradeRequest &Request, MqlTradeResult &Result )
If this is intended for indicators set by software, isn't it better to replace the highlighted with the indicator handle?
What is the "Result.deal correction" ?
Forum on trading, automated trading systems and trading strategies testing
Bugs, bugs, questions
fxsaber, 2017.02.23 15:34
From the BOD.
Completion of the resulting trade ticket is not guaranteed. Whether or not it fills depends on the execution mode of the instrument and the settings of the particular server.
Who laid down for a non-zero Result.deal - take action.
You don't have to set these parameters if you don't want to display the indicator.
Well ... I see that you can't count on a non-zero Result.deal. Then what does this line say?
// Учтены MT5-нюансы: Result.deal == 0
Where are they accounted for?
Well ... I see that you can't count on a non-zero Result.deal. Then what does this line say?
Where are they accounted for?
The overloaded (see above) HistoryDealSelect is called in OrderSendSync.
fxsaber:
Synchronization is no longer relevant. I only highlighted the piece responsible for Result.deal correction.