OBJ_BUTTON does not work on the Strategy Tester?

Back to topics list To post a new topic, please log in or register
avatar
12
marcelo0 2015.03.27 17:26
 

Hi Guys!

I just coded a "Buy button" in my EA using the feature "OBJ_BUTTON"

ObjectCreate(0,aux_Button_name,OBJ_BUTTON,0,xposition,yposition);

and put it into the "OnChartEvent"  for when I click on it, the EA issues an order.. It works on Demo/Live ,  however when I run it over the Strategy Tester it remains pressed and and does not issue any order..

Does anyone know how to make it works  with the Strategy Tester?

 

Many thanks

 

avatar
735
honest_knave 2015.03.27 19:14 #
 

A workaround I have used in the past is to check the button state each tick:

ObjectGetInteger(0,aux_Button_name,OBJPROP_STATE)

 If it is true, run what ever you need then reset the button state to false using:

ObjectSetInteger(0,aux_Button_name,OBJPROP_STATE,false);

 

You can use IsVisualMode() to avoid unnecessary processing under normal operation.

 

avatar
12
marcelo0 2015.03.28 12:28 #
 
honest_knave:

A workaround I have used in the past is to check the button state each tick:

 If it is true, run what ever you need then reset the button state to false using:

 

You can use IsVisualMode() to avoid unnecessary processing under normal operation.

 

Thank you  honest_knave

thaI did that before and it does work ..howecer it consumes more processor  right? :  ) but it works for sure! : )

Thanks a million for replying my post, and have a nice weekend! 

 

 

Back to topics list  

To add comments, please log in or register