|
こんな感じでしょうか?
過去24時間の高値・安値・値幅を表示させるようになっています。
//+------------------------------------------------------------------+
//| H_L_DIFF.mq4 |
//| Copyright ゥ 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ゥ 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
extern int CheckTime = 24; // 過去何時間の最高値・最安値をチェックするか
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int CT = CheckTime * 60 / Period();
//----最高値・最安値のチェック
double max = High[iHighest(NULL, 0, MODE_HIGH, CT, 0)];
double min = Low[iLowest(NULL, 0, MODE_LOW, CT, 0)];
//----最高値・最安値表示
Comment("MAX : ", max, " / MIN : ", min, " / Difference : ", max-min,);
//----
return(0);
}
//+------------------------------------------------------------------+
|
|