Problem with enumerations

 

Hi,

I wanted to code a script which changes the chart-mode (line, bars, candles) of all open charts. When dragging the script into a chart I want to choose the chart-mode with a pulldown-menu. But I don't know how to use the ENUM_CHART_MODE correctly. Can somebody please help me?


#property strict
#property show_inputs
enum chartType
{
    CHART_LINE,
    CHART_CANDLES,
    CHART_BARS
};
input chartType ch_Type=CHART_LINE;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---

   for (long chartID=ChartFirst(); chartID!=-1; chartID=ChartNext(chartID)) {
      ChartSetInteger(chartID, CHART_MODE, ch_Type);
   }
  }
//+------------------------------------------------------------------+
 
input ENUM_CHART_MODE ch_Type=CHART_LINE;
 
Ernst Van Der Merwe:

Thank you!!

 
enum chartType
{
    LINE=CHART_LINE,
    CANDLES=CHART_CANDLES,
    BARS=CHART_BARS
};
input chartType ch_Type=LINE;
 
Aliakbar Kavosi:

Thank you too! :)