Kleines GAP TRADEN

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #252625 quote
    axmichi
    Participant
    Senior

    Hallo,

    In einem 30 Minuten Chart möchte ich folgende Strategie umsetzen

     

    Entry Regeln

    Wenn der Schlusskurs von heute um 09 Uhr zwischen 0,5 % – 1 % höher liegt als das Hoch des Vortages, dann soll um 10 Uhr gekauft werden

    Der SL soll bei 1,5 % liegen

    Exit Regeln

    Liegt der Kurs am übernächsten Tag um 09 Uhr im Gewinn und über dem Supertrend Indikator (3, 10)

    Wird der Trade am supertrend getrailt und wird erst geschlossen, wenn der Supertrend gebrochen wird.

    oder

    Liegt der Kurs am übernächsten Tag um 09 Uhr unter dem Supertrend dann wird der Trade geschlossen

    Trademanagement

    Schön wäre noch, dass wenn der Trade mit einem CRV von 2:1 im Gewinn ist, soll sich der Supertrend näher an den Kurs ziehen und es soll für den Trailing die Werte Super Trend (2, 8) genommen werden. Sofern das geht

     

    Vielen Dank

    #252635 quote
    Iván González
    Moderator
    Master
    // --- System Parameters ---
    DEFPARAM CumulateOrders = FALSE
    // --- User-defined variables ---
    slPercentage = 1.5
    stFactor1 = 3
    stPeriod1 = 10
    stFactor2 = 2
    stPeriod2 = 8
    // --- Variable Initialization ---
    once trailstop = low
    once target2R = high
    // --- Entry Logic ---
    IF NOT ONMARKET THEN
       // Reset the day counter when not in a position
       daysOntrade = 0
       // Reset the buy signal at the start of each new day
       IF IntradayBarIndex = 0 THEN
          buySignalToday = 0
       ENDIF
       // 1. Check the entry condition at 09:00
       IF opentime = 090000 THEN
          percDiff = (close / DHigh(1) - 1) * 100
          IF percDiff >= 0.5 AND percDiff <= 1 THEN
             buySignalToday = 1
          ENDIF
       ENDIF
       // 2. Execute the buy order at 10:00 if the signal was triggered
       IF opentime = 100000 AND buySignalToday = 1 THEN
          BUY 1 CONTRACT AT MARKET
       ENDIF
    ENDIF
    // --- Position and Exit Management ---
    IF LONGONMARKET THEN // This block runs only once per trade, on the entry bar, to set initial values
       IF LONGONMARKET[1] = 0 THEN
          initialStopPrice = POSITIONPRICE * (1 - slPercentage / 100)
          trailStop = initialStopPrice
          initialRiskPoints = POSITIONPRICE - initialStopPrice
          target2R = POSITIONPRICE + (2 * initialRiskPoints)
          trailingState = 0// State 0: Initial SL, 1: Trailing ST(3,10), 2: Trailing ST(2,8)
       ENDIF // Priority check: Switch to aggressive trailing if 2:1 R:R target is hit
       IF close >= target2R AND trailingState < 2 THEN
          trailingState = 2 // Switch to aggressive trailing
       ENDIF // Check the "day after next" trailing condition (daysOntrade >= 2) // This is evaluated only once at 09:00 if still in the initial SL state (state 0)
       IF daysOntrade >= 2 AND opentime = 090000 AND trailingState = 0 THEN
          st1 = Supertrend[stFactor1, stPeriod1]
          IF POSITIONPERF > 0 AND close > st1 THEN
             trailingState = 1 // Start trailing with ST(3,10)
          ELSE
             SELL AT MARKET // Condition not met, close the position
          ENDIF
       ENDIF
       // Apply the Stop Loss based on the current state
       IF trailingState = 0 THEN
          // State 0: Initial fixed Stop Loss
          SET STOP PRICE trailStop
       ELSIF trailingState = 1 THEN
          // State 1: Trailing Stop with Supertrend (3,10)
          st1 = Supertrend[stFactor1, stPeriod1]
          trailStop = st1
          SET STOP PRICE trailStop
       ELSIF trailingState = 2 THEN     // State 2: Aggressive Trailing Stop with Supertrend (2,8) after hitting 2R target
          st2 = Supertrend[stFactor2, stPeriod2]
          trailStop = st2
          SET STOP PRICE trailStop
       ENDIF // Increment the day counter at the start of each new day in the trade
       IF IntradayBarIndex = 0 THEN
          daysOntrade = daysOntrade + 1
       ENDIF
    ENDIF
    
    // --- Chart Visualization ---
    graphonprice trailStop as "TrailStop" coloured("red")
    graphonprice target2R as "Target" coloured("green")
    
    graph percDiff as "%diff" coloured("red")
    graph 0.5 as "% min" coloured("blue")
    graph 1 as "% max" coloured("blue")
    graph 0 as "zero"
    
    robertogozzi thanked this post
    #252639 quote
    axmichi
    Participant
    Senior

    Hallo vielenDank, jedoch verstehe ich nicht, warum nach einigen Trades gleich wieder ein neuer Trade eröffnet wird, obwohl kein GAp da ist?? Siehe FOTO

    Getestet im MiniNasdaq

     

    Danke

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Kleines GAP TRADEN


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by axmichi
3 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 10/15/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...