引数名 | 初期値 | I/O | 詳細 |
index | - | In | インジケータバッファインデックス。
指定範囲は0~7です。 |
code | - | In | Wingdingsフォントかアローコード定数のシンボルコードを設定します |
// インジケータウインドウ設定 #property indicator_chart_window // インジケータをチャートウインドウに表示 // インジケータ設定 #property indicator_buffers 1 // インジケータバッファ:1つ設定 #property indicator_color1 clrYellow // インジケータ1の色:黄色 #property indicator_width1 2 // インジケータ1の太さ:2 double ExIndLine[100]; // インジケータバッファ:ヒストグラム用 //+------------------------------------------------------------------+ //| OnInit(初期化)イベント | //|------------------------------------------------------------------| void OnInit() { SetIndexBuffer(0,ExIndLine); // ExIndLineをインジケータ1に登録 SetIndexStyle(0 ,DRAW_ARROW); // インジケータスタイルをアローコードに設定 SetIndexArrow(0 ,SYMBOL_CHECKSIGN); // アローコードをチェックサイン記号に設定 ArrayInitialize(ExIndLine,0); // ExIndLine配列を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++ ) { if ( tick_volume[icount] > 20000 ) { // tick出来高が20000越え時に、バッファに高値を代入 ExIndLine[icount] = high[icount]; } } return(rates_total); }