So geht's
Code:
#property indicator_chart_window
#property indicator_plots 0
void OnDeinit(const int reason)
{
Comment("");
}
int OnInit()
{
return(INIT_SUCCEEDED);
}
int OnCalculate (const int rates_total,
const int prev_calculated,
const int begin,
const double& price[])
{
return(rates_total);
}
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
if(id==CHARTEVENT_OBJECT_CLICK) Comment("Object click"); else
if(id==CHARTEVENT_KEYDOWN) Comment("Key pressed"); else
if(id==CHARTEVENT_CHART_CHANGE) Comment("Chart changed");
}
Mit 'switch' gehts natürlich auch.
LG Otto