#property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { return(INIT_SUCCEEDED); } int start() { double spread = MarketInfo(Symbol(),MODE_SPREAD)*0.1; ObjectsDeleteAll(); ObjectCreate( "spread",OBJ_LABEL,0,0,0); ObjectSet("spread",OBJPROP_XDISTANCE,5); ObjectSet("spread",OBJPROP_YDISTANCE,18); ObjectSetText("spread","Spread:"+spread,20,"MS ゴシック",clrWhite); return(0); } //+------------------------------------------------------------------+ //| 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[]) { //--- //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+