ID | 詳細 | 型 |
INDICATOR_DIGITS | インジケータ描画の精度 | int |
INDICATOR_HEIGHT | インジケータウインドウの高さの固定値 (#property indicator_height) |
int |
INDICATOR_LEVELS | インジケータウインドウのレベルライン数 | int |
INDICATOR_LEVELCOLOR | レベルラインの色 全てのレベルラインに適用されます |
color |
INDICATOR_LEVELSTYLE | レベルラインのスタイル 全てのレベルラインに適用されます |
ENUM_LINE_STYLE |
INDICATOR_LEVELWIDTH | レベルラインの幅 全てのレベルラインに適用されます |
int |
ID | 詳細 | 型 |
INDICATOR_MINIMUM | インジケータウインドウの最小値 | double |
INDICATOR_MAXIMUM | インジケータウインドウの最大値 | double |
INDICATOR_LEVELVALUE | レベルの値 | double modifiler引数にレベル番号を指定 |
ID | 詳細 | 型 |
INDICATOR_SHORTNAME | インジケータの短縮名 サブウインドウの左上に表示されます。 |
string |
INDICATOR_LEVELTEXT | レベルの説明 | string modifiler引数にレベル番号を指定 |
// インジケータウインドウ設定 #property indicator_separate_window // インジケータをサブウインドウに表示 // インジケータ設定 #property indicator_buffers 1 // インジケータバッファ:2つに設定 #property indicator_color1 clrWhite // インジケータ1の色:Green #property indicator_width1 2 // インジケータ1の太さ:2 #property indicator_type1 DRAW_HISTOGRAM // インジケータ1の種類:ヒストグラム double ExIndVol[100]; // インジケータバッファ:ヒストグラム用 //+------------------------------------------------------------------+ //| 初期化 //|------------------------------------------------------------------| void OnInit(){ SetIndexBuffer(0,ExIndVol); // ExIndVolをインジケータ1に登録 IndicatorSetInteger( INDICATOR_DIGITS , 1 ); // 精度(小数点):小数点第1位に設定 IndicatorSetInteger( INDICATOR_HEIGHT , 200 ); // 価格スケールの高さ(pixel) IndicatorSetInteger( INDICATOR_LEVELS , 2 ); // レベルラインの表示数:2 IndicatorSetInteger( INDICATOR_LEVELCOLOR , clrYellow ); // レベルライン色:黄色 IndicatorSetInteger( INDICATOR_LEVELSTYLE , STYLE_DOT ); // レベルラインスタイル;ドット IndicatorSetInteger( INDICATOR_LEVELWIDTH , 1 ); //レベルライン幅:1 IndicatorSetDouble( INDICATOR_MINIMUM , -1000 ); // サブウインドウスケールの最小値 IndicatorSetDouble( INDICATOR_MAXIMUM , 3500 ); // サブウインドウスケールの最大値 IndicatorSetDouble( INDICATOR_LEVELVALUE , 0, 1000 ); // レベルライン1の設定値:1000 IndicatorSetDouble( INDICATOR_LEVELVALUE , 1, 2000 ); // レベルライン2の設定値:2000 IndicatorSetString( INDICATOR_SHORTNAME , "サブウインドウ用インジケータ名" ); IndicatorSetString( INDICATOR_LEVELTEXT , 0, "レベル1" ); // レベルライン1の説明 IndicatorSetString( INDICATOR_LEVELTEXT , 1, "レベル2" ); // レベルライン2の説明 } //+------------------------------------------------------------------+ //| 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] = (double)tick_volume[icount]; // インジケータバッファに出来高を代入 } return(rates_total); }