OnMarket mit Graph wird wohl ignoriert?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #171111 quote
    Rainer (RFW)
    Participant
    Senior
    If LongOnMarket Then
    LongProfit =(Close-(TradePrice+MSP))
    GRAPH (LongProfit) Coloured(100, 255, 150) AS "LongProfit"
    EndIf
    If ShortOnMarket Then
    ShortProfit =((TradePrice-MSP)-Close)
    GRAPH (ShortProfit) Coloured(100, 255, 150) AS "ShortProfit"
    Endif

    Hallo liebe PRTler,
    scheinbar  werden OnMarket Anweisungen in Verbindung mit Graph ignoriert.
    Wie auf dem Screenshot in der Anlage zu sehen; Flat, dennoch wird der Graph-Befehl ausgeführt. Mir ist klar, dass immer der letzte Tradeprice herangezogen wird, mir geht es einfach um die Graph-Ausführung als solche.
    Über Hilfe bei meinem Verständnis-Problem würde ich mich freuen.
    Danke vorab und schon einmal ein schönes Wochenende.
    Liebe Grüße
    Rainer

    #171114 quote
    robertogozzi
    Moderator
    Master

    Versuchen Sie, beide GRAPH-Befehle ans Ende nach der letzten Zeile zu verschieben.

    #171118 quote
    Rainer (RFW)
    Participant
    Senior

    Guten Morgen Roberto,
    WOW, Danke für die superschnelle Antwort, sehr nett.
    Der Code steht schon am Ende. Bin ratlos.
    Habe auch eine Zwischenlösung versucht, aber selbst die Steuerungs-Variablen, die korrekt gesetzt werden,  werden ignoriert?
    Bin ratlos.
    Nochmals Danke und liebe Grüße
    Rainer

    #171119 quote
    Rainer (RFW)
    Participant
    Senior

     

    // nach Order

    If LongOnMarket Then
    SPLC = 1
    LongProfit =(Close-(TradePrice+MSP))
    Else
    SPLC = 0
    EndIf
    If ShortOnMarket Then
    SPSC = 1
    ShortProfit =((TradePrice-MSP)-Close)
    Else
    SPSC = 0
    EndIf

    // am Ende
    If SPLC = 1 Then
    GRAPH (LongProfit) Coloured(100, 255, 150) AS “LongProfit”
    EndIf
    If SPSC = 1 Then
    GRAPH (ShortProfit) Coloured(100, 255, 150) AS “ShortProfit”
    Endif

    #171120 quote
    Rainer (RFW)
    Participant
    Senior

     

    // Reset am Code-Anfang
    SPLC = 0
    SPSC = 0
    LongProfit  = 0
    ShortProfit = 0
    
    // Nach Order-Platzierung
    If LongOnMarket Then
    SPLC = 1
    LongProfit =(Close-(TradePrice+MSP))
    Else
    SPLC = 0
    EndIf
    If ShortOnMarket Then
    SPSC = 1
    ShortProfit =((TradePrice-MSP)-Close)
    Else
    SPSC = 0
    EndIf
    
    
    // Am absoluten Code-Ende Ende
    GRAPH (SPLC) Coloured(255, 250, 205) AS "SPLC"
    GRAPH (SPSC) Coloured(255, 250, 205) AS "SPSC"
    
    If SPLC = 1 Then
    GRAPH (LongProfit) Coloured(100, 255, 150) AS "LongProfit"
    EndIf
    If SPSC = 1 Then
    GRAPH (ShortProfit) Coloured(100, 255, 150) AS "ShortProfit"
    Endif
    
    #171129 quote
    Rainer (RFW)
    Participant
    Senior
    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    LP = 20
    SP = 20
    MSP = 3
    SPLC = 0
    SPSC = 0
    LongProfit  = 0
    ShortProfit = 0
    
    
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = CCI[LP]
    c1 = (indicator1 CROSSES OVER -100) And (Close CROSSES OVER Average[LP](Close))
    
    // Bedingungen zum Einstieg in Short-Positionen
    indicator2 = CCI[SP]
    c2 = (indicator2 CROSSES UNDER 100) And (Close CROSSES UNDER Average[SP](Close))
    
    
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    IF c1 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    
    If LongOnMarket Then
    SPLC = 1
    LongProfit =(Close-(TradePrice+MSP))
    Else
    SPLC = 0
    LongProfit = 0
    EndIf
    If ShortOnMarket Then
    SPSC = 1
    ShortProfit =((TradePrice-MSP)-Close)
    Else
    SPSC = 0
    ShortProfit = 0
    EndIf
    
    
    // Stops und Targets
    SET STOP %LOSS 0.5
    SET TARGET %PROFIT 0.7
    
    
    If SPLC = 1 Then
    GRAPH (LongProfit) Coloured(100, 255, 150) AS "LongProfit"
    EndIf
    If SPSC = 1 Then
    GRAPH (ShortProfit) Coloured(100, 255, 150) AS "ShortProfit"
    Endif
    
    // Auch FLat wird stets der Graph-Befehl ausgeführt - Ratlos
    #171133 quote
    Rainer (RFW)
    Participant
    Senior

    Hallo nochmal,
    habe es mit Testen gelöst.
    Ist ein Graph-Befehl während einer Sitzung einmal aktiv, bleibt er stets aktiv. Insofern setze ich eben den Wert entsprechend bei Flat auf 0.
    So gehts.
    Liebe Grüße und schönes Wochenende.
    Rainer

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

OnMarket mit Graph wird wohl ignoriert?


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by Rainer (RFW)
4 years, 8 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 06/04/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...