Hallo,
ich habe ein Handelssystem, dass ich bisher nur in Excel manuell gebacktestet habe. Nun möchte ich das gerne in PRT tun. Leider sind meine Programmierkenntnisse nicht vorhanden. Evtl. kann mir jemand helfen. Das System ist ganz simpel.
Long: Wenn Hoch + (ATR[14]*0,10)
Short: Wenn Tief – (ATR[14]*0,10)
Stop Long: Tief – (ATR[14]*0,25)
Stop Short: Hoch + (ATR[14]*0,25)
Take Profit Long: Hoch + (ATR[14]*0,5)
Take Profit Short: Tief – (ATR[14]*0,5)
Alle Werte sind EndofDay und betreffen den Tag den Tag der Positionseroeffnung.
Vielen Dank schon mal.
Wenn ich richtig verstanden habe, sind die Hoch- und Tiefsten die vom Tageszeitpunkt und vom Vortag?
Hallo Nicolas, ja das stimmt.
Danke, ich denke, das Programm sollte Ihre Anfrage entsprechen. Bedingte Aufträge dauern nur einen Tag, ist das Programm „täglich“ auf eine Zeiteinheit zu verwenden.
defparam cumulateorders=false
if not onmarket then
atr=averagetruerange[14]
buy 1 contract at dhigh(1)+atr*0.1 STOP
sellshort 1 contract at dlow(1)-atr*0.1 STOP
buytp = (dhigh(1)+atr*0.5)-dhigh(1)
selltp = dlow(1)-(dlow(1)-atr*0.5)
buysl = dlow(1)-(dlow(1)-atr*0.25)
sellsl = (dhigh(1)+atr*0.25)-dhigh(1)
endif
if longonmarket then
set target profit buytp
set stop loss buysl
endif
if shortonmarket then
set target profit selltp
set stop loss sellsl
endif