Download MetaTrader 5
To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
Stephen Reynolds
483
Stephen Reynolds 2015.06.03 19:58 

In the code below I'm trying to draw a simple object on a sub window :

// Input variables 
input int KPeriod = 14;
input int DPeriod = 3;
input int Slowing = 3;
input ENUM_MA_METHOD StochMethod = MODE_SMA;
input ENUM_STO_PRICE StochPrice = STO_LOWHIGH;

// OnTick() event handler                
void OnInit() 
{  
   double stoch=iStochastic(_Symbol,_Period,KPeriod,DPeriod,Slowing,StochMethod,StochPrice,MODE_MAIN,0);
   datetime time=iTime(NULL,0,0);

   bool line1=ObjectCreate("Thumb",OBJ_ARROW_THUMB_UP,0,time,stoch);
}


Why cant I get the ObjectCreate() function to put an object on sub window? I've put 1 on 3rd parameter as required but it still doesn't draw any object?
When I place 0 it does draw the object okay on the main chart but why not stochastic?

Here I'm confused? I'm beginning to think ObjectCreate () can only draw objects on main window?

/
To add comments, please log in or register