if an expert use several indicator, can do something to don't draw/show them in strategy tester ?
![Documentation on MQL5: MQL5 programs / Testing Trading Strategies Documentation on MQL5: MQL5 programs / Testing Trading Strategies](/i/community/logo_mql5_small.png)
- www.mql5.com
Yes, see documentation : https://www.mql5.com/en/docs/runtime/testing#indicatorrelease
thank you to reply; ( and thank you for lik )
i had before only used ;
//+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping for ATR SetIndexBuffer(0,ATR_Buffer,INDICATOR_DATA); ATR_Handle = iATR(_Symbol, _Period, ATR_Period ); if(ATR_Handle<0) { Alert("Error Creating Handles for indicators - error: ",GetLastError(),"!!"); return(-1); } //--- return(0); } //+------------------------------------------------------------------+ void OnDeinit(const int reason) { Comment(""); IndicatorRelease(ATR_Handle); } //+------------------------------------------------------------------+ void OnTick() { . . ArraySetAsSeries(ATR_Buffer,true); // Array for ATR int copy_ATR=CopyBuffer(ATR_Handle, 0, 0, 200, ATR_Buffer); . .
and i correct it to this :
//+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping for ATR SetIndexBuffer(0,ATR_Buffer,INDICATOR_DATA); ATR_Handle = iATR(_Symbol, _Period, ATR_Period ); if(ATR_Handle<0) { Alert("Error Creating Handles for indicators - error: ",GetLastError(),"!!"); return(-1); } //--- return(0); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { NUMBER_OF_PENDING_ORDER=0; Comment(""); bool hidden=IndicatorRelease(ATR_Handle); if(hidden) Print("IndicatorRelease() successfully completed"); else Print("IndicatorRelease() returned false. Error code ",GetLastError()); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { . . ArraySetAsSeries(ATR_Buffer,true); // Array for ATR int copy_ATR=CopyBuffer(ATR_Handle, 0, 0, 200, ATR_Buffer); //--- free the handle of the indicator if(!IndicatorRelease(ATR_Handle)) Print("IndicatorRelease() failed. Error ",GetLastError()); . .
and i get this error :
ERR_FUNCTION_NOT_ALLOWED |
4014 |
System function is not allowed to call |
can you please check what is wrong ?
thank you.
thank you to reply; ( and thank you for lik )
i had before only used ;
and i correct it to this :
and i get this error :
ERR_FUNCTION_NOT_ALLOWED |
4014 |
System function is not allowed to call |
can you please check what is wrong ?
thank you.
IndicatorRelease() doesn't work in Visual Mode of Strategy Tester.
oh yes you get it,
so, there is no solution.
thank you.
oh yes you get it,
so, there is no solution.
thank you.
Indeed, I already asked explanation to Service Desk, and got following answer :
You cannot release indicators in the visual mode...
This behavior was implemented from begin of visual testing and will not changed
hello
if an expert use several indicator, can do something to don't draw/show them in strategy tester ?
thank's in advance.
![Documentation on MQL5: Standard Constants, Enumerations and Structures / Named Constants / Other Constants Documentation on MQL5: Standard Constants, Enumerations and Structures / Named Constants / Other Constants](/i/community/logo_mql5_small.png)
- www.mql5.com
interesting; i will chek
and is there possible to change the height of those seperate window ( may be we have several indicator),in order to release screen ?
& thank to reply.
In your indicator you can use something like :
IndicatorSetInteger(INDICATOR_HEIGHT,0);
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello
if an expert use several indicator, can do something to don't draw/show them in strategy tester ?
thank's in advance.