読み取り専用

フォーラムは現在、読み取り専用のアーカイブとなっています。.

バグ報告やプラットフォームに関する質問はこちら → [email protected]

私たちのコミュニティはDiscordとYouTubeで活動しています。ぜひ参加してください!

ご参加ください Discord YouTube

Candle Size Ranges

1件の返信

mjran

購読者、bbp_participant、コミュニティ、1 件の返信。.

プロフィールを表示

13年前 #111267

こんにちは、,

 

Does anyone know how I would define a rule in Strategy Quant which uses an average of the size range of a set of candlesticks? For example, if I wanted to buy if the 11th candle was 10% greater in size than the average of the range of the preceeding 10 candles, rather than simply buying on the high of a 10 candle period, then how would I define that rule using Strategy Quant?

 

ありがとう

 

マーク

0

マーク・フリック

管理者、sq-ultimate、2件の返信.

プロフィールを表示

13年前 #121901

こんにちは、,

 

getting average range of previous X candles would be possible only using a custom function, see on the bottom.

But you can use Average True Range (ATR), it is very similar. ATR(10) means average true range of last 10 candles.

 

The condition that range of current candle is 10% bigger than ATR(10) would be:

BarRange(0) > 1.1 * ATR(10)

 

1.1 means 10% more. 1.2 is 20% more and so on.

 

But I expect this condition will be true very often.

 

double sqAverageRange(int period, int shift) {
    double avg = 0;

    for(int i=shift; i<shift+period; i++) {
        avg = avg + iHigh(NULL, 0, i) – iLow(NULL, 0, i);
    }

    return(avg / period);
}

マーク
StrategyQuantアーキテクト

1

1件の返信を表示中 - 1 - 1件目 (全1件中)