Backtest Problem

 

anybody help regarding HOW TO CLICK my EA Controls\Button during backtest.

***coz when I click nothing happens, not like in demo/real chart.

 
OnChartEvent() does not work in the tester so you will need to put the code that checks the button state in OnTick()
 
Keith Watford:
OnChartEvent() does not work in the tester so you will need to put the code that checks the button state in OnTick()

thank you Mr. Keith for the early reply. i'm very proud of your move, after these i go back to editor and follow your suggestion. Thank you again.

 
   if(ObjectFind(0,"btnS")>=0)
     {
      if(OBJPROP_STATE==1)
        {Print("Pressed");}
     }

What do you expect this to do?

Try

   if(ObjectFind(0,"btnS")>=0)
     {
      if(ObjectGetInteger(0,"btnS",OBJPROP_STATE) )
        {Print("Pressed");}
     }

and of course make sure that there is a button  called "btns"

 
Are you pausing the tester when you press the button? If so nothing will happen until you unpause and so the next tick executes the code.
 
Michael Quinatadcan Macasil Macasil:

whats wrong with codes? is this because i'm using dialog? 

Shouldn't make any difference.

 
Mr. Keith i'm very HAPPY with your HELP. CASE IS SOLVE. 
if(ObjectFind(0,"btnS")>=0)
     {
      if(ObjectGetInteger(0,"btnS",OBJPROP_STATE))
        {
         Print("Pressed");
         aiSmt();//trade.Sell module
        }
     }

i used this code now  in normal button

and not functional below button

btnS.Create(ChartID(),"btnS",0,2,210,115,250);

  its okay for now.

Again thank you for attending my problem. CASE IS SOLVE. happy coding to ALL of you guys. 



 
Keith Watford:
Are you pausing the tester when you press the button? If so nothing will happen until you unpause and so the next tick executes the code.

no i'm not pausing.

Reason: