I write the code below but it doesn't show anything on the chart and i dont know why?
#property indicator_chart_window
void OnStart()
{
double weekly_open = iOpen(NULL, PERIOD_W1, 0);
double daily_open = iOpen(NULL, PERIOD_D1, 0);
// Draw the weekly open as a line on the chart
ObjectCreate("weekly_open", OBJ_HLINE, 0, Time[0], weekly_open);
ObjectSet("weekly_open", OBJPROP_COLOR, Blue);
// Draw the daily open as a line on the chart
ObjectCreate("daily_open", OBJ_HLINE, 0, Time[0], daily_open);
ObjectSet("daily_open", OBJPROP_COLOR, Red);
}
This should show 2 lines on graph for daily open and weekly open