MT4 - High-Low Indicator code not working

 

This should be simple - I'm just looking to display the high-low of the current chart in a sub window. 

This does open the window but doesnt display anything. even though I change the color before adding it. What am I doing wrong?  

Thanks...

#property indicator_separate_window
#property strict

// Global variable to store the label handle
int labelHandle;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   // Create a label to display the difference
   labelHandle = ObjectCreate(0, "PriceDifferenceLabel", OBJ_LABEL, 0, 0, 0);
   ObjectSetInteger(0, "PriceDifferenceLabel", OBJPROP_XDISTANCE, 10);
   ObjectSetInteger(0, "PriceDifferenceLabel", OBJPROP_YDISTANCE, 10);
   ObjectSetText(labelHandle, "", 10, "Arial", White);

   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   // Calculate the difference between high and low
   double priceDifference = high[0] - low[0];

   // Display the difference on the chart
   string text = StringFormat("High-Low Difference: %.5f", priceDifference);
   ObjectSetText(labelHandle, text, 10, "Arial", White);

   return(rates_total);
}
 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
ObjectCreate does not return a handle. Perhaps you should read the manual.
   How To Ask Questions The Smart Way. (2004)       How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.
 
William Roeder #:
ObjectCreate does not return a handle. Perhaps you should read the manual.
   How To Ask Questions The Smart Way. (2004)       How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

That didnt help and also seemed rather rude to someone like me who is trying to learn. 

RTFM really doesnt show any knowledge on your part but rather rudeness.