Target zu einer bestimmten Zeit

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #128922 quote
    robertogozzi
    Moderator
    Master

    Los geht’s:

    defparam flatbefore = 080500
    defparam flatafter  = 213000
    //
    if intradaybarindex=0 then
       trading=1
    elsif barindex=tradeindex then
       trading=0
    endif
    //
    if time = 080500 then
       mypriceL=close-AverageTrueRange[14](close)*3
       tpL = close-mypriceL
       slL = tpL * 2
       mypriceS=close+AverageTrueRange[14](close)*3
       tpS = mypriceS-close
       slS = tpS * 2
    elsif time> 080500 and time[1] < 080500 then
       mypriceL=close[1]
       mypriceS=close[1]
    endif
    // 
    if not longonmarket and trading=1 then
       buy 1 share at mypriceL limit
       set stop   loss   slL
       set target profit tpL
       BreakEven = tpL * 0.7
    endif
    //
    if not shortonmarket and trading=1 then
       sellshort 1 share at mypriceS limit
       set stop   loss   slS
       set target profit tpS
       BreakEven = tpL * 0.7
    endif
    //
    IF LongOnmarket THEN
       IF ExitPrice = 0 THEN
          IF (close - TradePrice) >= BreakEven THEN
             ExitPrice = TradePrice
          ENDIF
       ELSE
          SELL AT ExitPrice STOP
       ENDIF
    ELSIF ShortOnMarket THEN
       IF ExitPrice = 0 THEN
          IF (TradePrice - close) >= BreakEven THEN
             ExitPrice = TradePrice
          ENDIF
       ELSE
          EXITSHORT AT ExitPrice STOP
       ENDIF
    ELSE
       ExitPrice = 0
    ENDIF

    Ich habe PLOSS in LOSS geändert.

    Ich habe die Gewinnschwelle hinzugefügt, wenn ein Gewinn von 70% erreicht ist.

    Ich habe sowohl Short- als auch Long-Trades hinzugefügt.

    Ich füge separate SL und TP für Short- und Long-Trades hinzu.

    @ axmichi Zeile 15 für kurz SL ist falsch, es sollte geschrieben werden

     SL = (myprice-close)

    Ich hänge auch die .ITF-Datei an.

    #128933 quote
    axmichi
    Participant
    Senior

    OMG Daaaaanke Du bist der Wahnsinn wie kann man so was können?? 🙂

    robertogozzi thanked this post
    #128941 quote
    bertrandpinoy
    Participant
    Veteran

    Auf welcher Zeiteinheit und auf welchem Wert testen Sie diese ITF?

    #128957 quote
    robertogozzi
    Moderator
    Master

    Da sich die Strategie auf 080500 bezieht, jeder Zeitrahmen, dessen Balken genau zu dieser Stunde endet, also 5 Minuten oder 1 Minute oder in 10 Sekunden.

    bertrandpinoy thanked this post
Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.

Target zu einer bestimmten Zeit


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 18 replies,
has 4 voices, and was last updated by robertogozzi
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 04/26/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...