Errors, bugs, questions - page 1015

 
Andrew1469:

Then where can I find a CFD for Metatrader 5?

I'm trying to get into the numbers, but I'm somewhat hampered by the lack of clarity in the documentation, e.g. the enum tables don't list the corresponding numbers. I have found by experience that SYMBOL_CALC_MODE_FOREX is 0, but 33 and 34 are not identified in the opening server response in any way.

Regarding swaps - do I understand correctly that PositionGetDouble(POSITION_SWAP) and HistoryDealGetDouble(Deal_Ticket,DEAL_SWAP) actually give the accumulated swap in the deposit currency regardless of how it is credited?

Welltrade, the swap that is reflected in the terminal for the position by the symbol PositionGetDouble(POSITION_SWAP), HistoryDealGetDouble(Deal_Ticket,DEAL_SWAP) accumulated by the history of the trade. There is a dependence and it is determined by the trade conditions.

Use the comparison in the if construction.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций - Документация по MQL5
 
zfs:

welltrade, that swap that is reflected in the terminal per position by PositionGetDouble(POSITION_SWAP), HistoryDealGetDouble(Deal_Ticket,DEAL_SWAP) accumulated by trade history. There is a dependence and it is determined by the trade conditions.

Use the comparison in the if construction.

Thank you!
 

Please advise.
There is an Expert Advisor code:

string symbol="GBPUSD";
//+------------------------------------------------------------------+
void OnInit()
{
   long chartid=ChartOpen(symbol,_Period);
   int handle=iMACD(symbol,_Period,12,26,9,PRICE_CLOSE);
   ChartIndicatorAdd(chartid,1,handle);
   ChartRedraw(chartid);
}
//+------------------------------------------------------------------+

If you close the newly opened window, everything closes normally and quickly.

Modify the code:

string symbol="GBPUSD";
//+------------------------------------------------------------------+
void OnInit()
{
   long chartid=ChartOpen(symbol,_Period);
   int handle=iCustom(symbol,_Period,"Examples\\MACD",12,26,9,PRICE_CLOSE);
   ChartIndicatorAdd(chartid,1,handle);
   ChartRedraw(chartid);
}
//+------------------------------------------------------------------+

And when closing the window, the terminal hangs for a second or so.

Why iCustom hangs?

 

I have a question. About the organisation of optimisation in the strategy tester. Are there any provisions for saving the results of optimization work, so that you can resume it later? In case the optimisation takes a long time, more than one day.

 
Stasikusssss:

I have a question. About the organisation of optimisation in the strategy tester. Are there any provisions for saving the results of optimization work, so that you can resume it later? In case the optimisation takes a long time, more than one day.

If I am not mistaken, such a feature is implemented - test logs are saved. However, if you compile the Expert Advisor again after the test, even if there were no changes, the log is reset
 
A100:

When using a parametric form, no more than 8 parameters are allowed. But here it looks like 3 parameters!?

You have one closing parenthesis missing in your macro.
 
Can someone help with my question?
 
fyords:
Can someone help with my question?

Developers only. In servicedesk.

// You're not urging me to hack the terminal to find out how iCustom() works and how its call is different from others... ?

;)

 
MetaDriver:
Developers only. Service Desk.
Thanks, man. Thought it would be faster here.
 
MetaDriver:
You have one closing parenthesis missing in your macro.

Yes, thanks, I made a mistake when simplifying the source code - now I've rewritten the error differently

#define  F1( N, X ) ((X) + (N))
#define  F2( X, N ) F1( N, X )

#define  FF( N, X, F )    F( N, F( N, X ))
#define  FFF( N, X, F )   F( N, F( N, F( N, X )))
#define  FFFF( N, X, F )  F( N, F( N, F( N, F( N, X ))))
#define  FFFFF( N, X, F ) F( N, F( N, F( N, F( N, F( N, X )))))

void OnStart()
{
Print( FF( 1, 1, F2 ) ); // нормально
Print( FFF( 1, 1, F2 ) ); // нормально
Print( FFFF( 1, 1, F2 ) ); // ошибка компиляции
Print( FFFFF( 1, 1, F2 ) ); // ошибка компиляции
} 
I deleted the previous one to avoid confusion. You can see from the example that a compilation error occurs at a certain nesting level