Download MetaTrader 5
To add comments, please log in or register
Improve your rating. Execute orders in Freelance service!
DD
16
DD 2016.01.31 14:43 

Hello,

actually iam coding some arrow indicator where i want the arrows to disappear live when conditions are not met and re-appear when conditions are met (on the current candle)

 

i have tried creating a function DeleteArrow() but something is wrong  , if anybody can post some example code would be very good thanks

Mohammad Soubra
24604
Mohammad Soubra 2016.01.31 17:02  
DD:

Hello,

actually iam coding some arrow indicator where i want the arrows to disappear live when conditions are not met and re-appear when conditions are met (on the current candle)

 

i have tried creating a function DeleteArrow() but something is wrong  , if anybody can post some example code would be very good thanks

does the following right with you????

 

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   ObjectsDeleteAll();
   Comment("");
}
DD
16
DD 2016.01.31 18:35  
Mohammad Soubra:

does the following right with you????

 

Soubra thanks for your help ,but what i want is that suppose the conditions are met and arrow appears (instantly)  however after few seconds the conditions are voided but the arrow is still over there , so basically i want to remove that arrow exactly when the conditions are voided and reappear when conditions are met , thanks.
Marco vd Heijden
Moderator
4680
Marco vd Heijden 2016.01.31 18:38  

Then you write the exact same but opposite logic with the activity that removes the arrow.

It could be the case that it then starts to continuously remove none existent arrows, so you have it scan for an arrow first and if it exist, remove it..

Also you can set all variables to zero, then the object exists, but will not be visible, and when you need it, assign the correct values so it shows up where you need it, and if it needs to go reset it to zero again.

Many solutions as you see.

DD
16
DD 2016.01.31 19:03  
Marco vd Heijden:

Then you write the exact same but opposite logic with the activity that removes the arrow.

It could be the case that it then starts to continuously remove none existent arrows, so you have it scan for an arrow first and if it exist, remove it..

Also you can set all variables to zero, then the object exists, but will not be visible, and when you need it, assign the correct values so it shows up where you need it, and if it needs to go reset it to zero again.

Many solutions as you see.

If you can show some example code , would be great to me , thanks
DD
16
DD 2016.02.01 15:31  
OK now it is fixed thanks :)
/
To add comments, please log in or register