引数名 | 初期値 | I/O | 詳細 |
digits | - | In | 精度フォーマット。
小数点以下の桁数を指定します |
// インジケータウインドウ設定 #property indicator_separate_window // インジケータをサブウインドウに表示 #property indicator_minimum 0 // サブウインドウのスケール下限:-1000 #property indicator_maximum 3500 // サブウインドウのスケール上限: 3500 // インジケータ設定 #property indicator_buffers 1 // インジケータバッファ:1つ設定 #property indicator_color1 clrGreen // インジケータ1の色:Green #property indicator_width1 2 // インジケータ1の太さ:2 #property indicator_type1 DRAW_HISTOGRAM // インジケータ1の種類:ヒストグラム double ExIndVol[100]; // インジケータバッファ:ヒストグラム用 //+------------------------------------------------------------------+ //| OnInit(初期化)イベント | //|------------------------------------------------------------------| void OnInit() { SetIndexBuffer(0,ExIndVol); // ExIndVolをインジケータ1に登録 IndicatorDigits(0); // インジケータ値の精度設定 } //+------------------------------------------------------------------+ //| OnCalculate(tick受信)イベント | //+------------------------------------------------------------------+ 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[], // Tick出来高 const long& volume[], // Real出来高 const int& spread[]) // スプレッド { int icount = 0; int icountend; icountend = rates_total - prev_calculated; if ( icountend >= rates_total ) { icountend = rates_total - 1; } for( icount = 0; icount <= icountend ; icount++ ) { ExIndVol[icount] = tick_volume[icount]; // インジケータバッファに出来高を代入 } IndicatorShortName( "精度テスト"); return(rates_total); }