mqlbandi-tamplate

 

Welcome!

What could be the reason for the following program code to load the specified chart but not load the specified template?

The template is located in the template folder.



void OnTick()

{

  // Create Object



ObjectCreate

(

_Symbol,

"BuyButton",

OBJ_BUTTON,0,0,0);

ObjectSetInteger (_Symbol,"BuyButton",OBJPROP_XDISTANCE,200);

ObjectSetInteger (_Symbol,"BuyButton",OBJPROP_XSIZE,50);

ObjectSetInteger (_Symbol,"BuyButton",OBJPROP_YDISTANCE,200);

ObjectSetInteger (_Symbol,"BuyButton",OBJPROP_YSIZE,20);

ObjectSetInteger (_Symbol,"BuyButton",OBJPROP_CORNER,3);

}

void OnChartEvent(const int id,

                  const long   &lparam,

                  const double &dparam,

                  const string &sparam)



{

if(id==CHARTEVENT_OBJECT_CLICK)

 {

  if(sparam=="BuyButton")

  {

    Comment(sparam+" was pressed");

 ChartOpen("EURCHF",PERIOD_M1);

 ChartApplyTemplate(0,"Big-window.tpl");



}

}

}
 
mqlbandi:

Welcome!

What could be the reason for the following program code to load the specified chart but not load the specified template?

The template is located in the template folder.



The reason is because you spell template wrongly and NOT look back, correct that and come back to us we the consider you.

 
  1. There is no such word as:

    tamplate

  2. It takes time to open a chart. You have no delay.
  3. You apply your template to the current chart, not the new one.