読み取り専用

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

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

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

ご参加ください Discord YouTube

pseudo code

4件の返信

ベンジャミン・ピアス

購読者、bbp_participant、顧客、コミュニティ、sq-ultimate、16件の返信。.

プロフィールを表示

2年前 #286064

Is there a guide out there for interpreting pseudo code?

0

Tomas Matejka

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

プロフィールを表示

2年前 #286070

こんにちは、,

we have no docs for this. Feel free to ask any questions here about pseudo code

0

ベンジャミン・ピアス

購読者、bbp_participant、顧客、コミュニティ、sq-ultimate、16件の返信。.

プロフィールを表示

2年前 #286091

Here is a pseudo code for a strategy with only the parameter highest lowest bar opens above highest after opened below.

Can you tell me what the code means?  Thank you!

// Pseudo Source Code of Strategy 0.2
//
//   Generated by StrategyQuant X Build 138 for Tradestation
//   at 03/29/2024 22:14
//
//   Backtested on EURUSD_M1 / D1, 2003.05.05 – 2024.03.08
//   Backtest engine: Tradestation
//——————————————————————–
//——————————————————————–
//  Strategy Parameters
//——————————————————————–
int MagicNumber = 11111;
int BarOpensPeriod1 = 1300;
double StopLossCoef1 = 2.2;
double TrailingStopCoef1 = 6;
double TrailingActCef1 = 6;
メインチャート = 現在のシンボル / 現在の TF;
//——————————————————————–
//取引オプションのロジック
//——————————————————————–
Don’t Trade On Weekends = false (Friday 0038 – Sunday 0038);
Exit at End Of Day = false (2304);
Exit On Friday = false (2040);
LimitSignalsTimeRange = false (0800 – 1600, Exit at End: false, Orders to close: All);
LimitMaxDistanceFromMarketPrice = false;   //Limit max distance
MaxDistanceFromMarketPct = 6;   //Max distance %
MaxTradesPerDay = 1;
Min SL: 0、Max SL: 0、Min PT: 0、Max PT: 0; // ticks/pips単位で、0は無制限です
//——————————————————————–
// 取引ルール:取引シグナル(バーオープン時)
//——————————————————————–
LongEntrySignal = (Bar opens above Highest(Main chart, BarOpensPeriod1, PRICE_HIGH) after opened below)[1]
;
ShortEntrySignal = (Bar opens below Lowest(Main chart, BarOpensPeriod1, PRICE_LOW) after opened above)[1]
;
LongExitSignal = false;
ShortExitSignal = false;
//——————————————————————–
// 取引ルール:ロングエントリー(バーオープン時)
//——————————————————————–
LongEntrySignal がイネーブルの場合
{
    // アクション #1
    マーケットでロング注文を開設する;;
        重複した取引:無効化済み;;
        Stop Loss = StopLossCoef1 * ATR(20);
        Trailing Stop = TrailingStopCoef1 * ATR(20), TS Activation at TrailingActCef1 * ATR(130);
}
//——————————————————————–
// 取引ルール:ショートエントリー(バーオープン時)
//——————————————————————–
if (ShortEntrySignal)
   そして、LongEntrySignal)
{
    // アクション #1
    マーケットでショートオーダーを開く;;
        重複した取引:無効化済み;;
        Stop Loss = StopLossCoef1 * ATR(20);
        Trailing Stop = TrailingStopCoef1 * ATR(20), TS Activation at TrailingActCef1 * ATR(130);
}
//——————————————————————–
// 取引ルール:ロング・エグジット(バーオープン時)
//——————————————————————–
if ((LongExitSignal
   そして、LongEntrySignal)
   および(MarketPosition(“Any”, MagicNumber, “”)は Long)
{
    // アクション #1
    Close all positions for Symbol = Any and Magic Number = MagicNumber;
}
//——————————————————————–
// 取引ルール:ショート・エグジット(バーオープン時)
//——————————————————————–
(ShortExitSignal) が True になると
   そして、Not ShortEntrySignal)
   および(MarketPosition(“Any”, MagicNumber, “”)は Short)
{
    // アクション #1
    Close all positions for Symbol = Any and Magic Number = MagicNumber;
}
Broker: No filter

 

0

MontanoLuik

定期購入者、bbp_participant、顧客、コミュニティ、sq-ultimate、2件の返信。.

プロフィールを表示

2年前 #286184

Please don’t take this as the word of an expert and check with other sources, but this is my interpretation.
<h3>General Setup and Parameters</h3>

  • MagicNumber: A unique identifier (11111) for distinguishing trades opened by this strategy from others.
  • BarOpensPeriod1: This is set to 1300, likely representing a period or look-back count for determining trading signals based on price highs and lows.
  • StopLossCoef1, TrailingStopCoef1, TrailingActCef1: These are coefficients used to calculate the stop loss and trailing stop values based on the ATR (Average True Range, a volatility indicator), where ATR(20) and ATR(130) are used.

<h3>Main Chart</h3>

  • The strategy operates on the current symbol and time-frame, which is typically the chart where the strategy is applied.

<h3>Trading Options Logic</h3>

  • Trading Times: It includes settings to control trading times, like not trading on weekends and specifics about when to exit trades (end of day, Fridays, etc.).
  • Limitations on Trading: Includes settings to restrict trading based on time within a day and the maximum distance from the market price at which orders can be placed.
  • Trade Management: It sets limits on the number of trades per day and details the range for setting stop loss (SL) and profit target (PT) values, although these are set to 0, indicating no limit.

<h3>売買シグナル</h3>

  • LongEntrySignal and ShortEntrySignal: These are conditions defined to trigger entry into trades. A long entry occurs when the bar opens above the highest price of the specified period after opening below it in the previous period, and vice versa for a short entry.

<h3>Trading Rules for Entries and Exits</h3>

  • 長文エントリー: If the LongEntrySignal is true, the strategy will execute a market order to go long. It sets a stop loss and a trailing stop based on the ATR, and specifies conditions for when the trailing stop should activate.
  • 短いエントリー: Similar to long entry, but for going short. It ensures a short trade is not opened if a long entry signal is also true.
  • Long and Short Exits: These are conditions under which the strategy will close long or short positions, respectively. It checks if an exit signal is true and there’s no corresponding entry signal, and it ensures the trade to be closed matches the specified magic number.

<h3>Miscellaneous</h3>

  • Broker: Indicates that no specific broker filters or settings are applied.

<h3>まとめ</h3>
This pseudo-code outlines a strategy that enters long or short positions based on specific conditions related to the opening prices relative to previous highs and lows. It manages trades by setting stop losses and trailing stops based on the ATR, which helps manage risk according to market volatility. The strategy also includes rules for when to trade or not (e.g., not on weekends, specific times of day), and has mechanisms to close positions under defined conditions to secure profits or limit losses.
<h3>VALUES AND SETTINGS</h3>
 
<h3>戦略パラメーター</h3>

  • MagicNumber: 11111
  • BarOpensPeriod1: 1300
  • StopLossCoef1: 2.2
  • TrailingStopCoef1: 6
  • TrailingActCef1: 6
  • Main chart: Current Symbol / Current Time Frame

<h3>Trading Options Logic</h3>

  • Don’t Trade On Weekends: false (From Friday at 00:38 to Sunday at 00:38)
  • Exit at End Of Day: false (Time set at 23:04)
  • Exit On Friday: false (Time set at 20:40)
  • LimitSignalsTimeRange: false (From 08:00 to 16:00, Exit at end: false, Orders to close: All)
  • LimitMaxDistanceFromMarketPrice: false
  • MaxDistanceFromMarketPct: 6%
  • MaxTradesPerDay: 1
  • Minimum Stop Loss: 0, Maximum Stop Loss: 0 (in ticks/pips, 0 means unlimited)
  • Minimum Profit Target: 0, Maximum Profit Target: 0 (in ticks/pips, 0 means unlimited)

<h3>売買シグナル</h3>

  • LongEntrySignal: True if the bar opens above the highest price (high) of the last 1300 bars after previously opening below.
  • ShortEntrySignal: True if the bar opens below the lowest price (low) of the last 1300 bars after previously opening above.

<h3>Trading Rules for Entries and Exits</h3>

  • Long Entry Actions:
    • Open a long order at the market price.
    • Set a stop loss at 2.2 times the ATR(20).
    • Set a trailing stop at 6 times the ATR(20), with activation at 6 times the ATR(130).
  • Short Entry Actions:
    • Open a short order at the market price.
    • Set a stop loss at 2.2 times the ATR(20).
    • Set a trailing stop at 6 times the ATR(20), with activation at 6 times the ATR(130).

<h3>Exit Conditions</h3>

  • Long Exit: Close all long positions if there is a long exit signal and no new long entry signal, for any symbol with the specified MagicNumber.
  • Short Exit: Close all short positions if there is a short exit signal and no new short entry signal, for any symbol with the specified MagicNumber.

1

ベンジャミン・ピアス

購読者、bbp_participant、顧客、コミュニティ、sq-ultimate、16件の返信。.

プロフィールを表示

2年前 #286229

Thank you, MontanoLuik!  I appreciate the time you took for this.  I wonder if it’s possible to make this forum searchable so that your answer can be found easily for future users.

0

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