Codesyntax bei nur einem Trade pro Tag

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #15193 quote
    adrian
    Participant
    New

    Hallo

    ich komme einfach nicht mit der Programmierung von NUR EINEM TRADE PRO TAG zurecht.Habe alle Forum durchsucht und es versucht.Klappt aber nicht mit der Syntax.
    Ich poste mal hier mein Grundcode vielleicht kann mir jemand helfen.

    Gruss und Danke
    Adrian

    DEFPARAM FLATBEFORE=800000
    DEFPARAM FLATAFTER=220000
    DEFPARAM CumulateOrders = False
    
    // open long Kondition=
    c1
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // open short Kondition =
    c2
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    SET STOP LOSS 85
    SET TARGET PROFIT 45

     

    Gruss und Danke
    Adrian

    #15209 quote
    Nicolas
    Keymaster
    Master

    Sie wollen also nur mal täglich traden? Ist das richtig?

    #15229 quote
    adrian
    Participant
    New

    hallo Herr Nicolas,
    vielen Dank für ihre Nachfrage.

    ja ich möchte nur einen trade pro Tag ausführen.immer nur der erste der ausgelöst wird

    #15277 quote
    Nicolas
    Keymaster
    Master

    Ok, finden Sie unten die Prorealtime-Code in Ihre Strategie für nur 1 Handel pro Tag angepasst:

    DEFPARAM FLATBEFORE=800000
    DEFPARAM FLATAFTER=220000
    DEFPARAM CumulateOrders = False
    
    if intradaybarindex=0 then 
     traded=0
    endif
    
    // open long Kondition=
    c1
    
    IF c1 and traded=0 THEN
    BUY 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    
    // open short Kondition =
    c2
    
    IF c2 and traded=0 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    
    SET STOP LOSS 85
    SET TARGET PROFIT 45
    #15326 quote
    adrian
    Participant
    New

    Vielen Dank Herr Nicolas für Ihre schnelle Antwort.

    Sobald Ich ihren Code eingebe finden keine Trades mehr statt.Ich trade intraday zwischen 5 Min und 1 Stunde:Je nachdem welchen Indikator ich benutze.
    WAS MACHE ICH FALSCH?

    Gruss Adrian

    #15358 quote
    Nicolas
    Keymaster
    Master

    Ich weiß nicht, Sie haben uns nicht Ihre c1 und c2 Bedingungen … (Zeilen 10 und 18). Sie müssen Ihre Aufträge unter Bedingungen definieren.

    #15377 quote
    adrian
    Participant
    New

    sorry oben fehlt die hälfte!

    DEFPARAM FLATBEFORE=800000
    DEFPARAM FLATAFTER=220000
    DEFPARAM CumulateOrders = False
    if intradaybarindex=0 then
    traded=0
    endif
    // open long Kondition=close higher then the highest close of the50 past close
    c1=close>highest[50](close)[1]
    IF c1 and traded=0 THEN
    BUY 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    // open short Kondition =open lower then the lowest open of the 50 past open
    c2=open<lowest[50](close)[1]
    IF c2 and traded=0 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    SET STOP LOSS 85
    SET TARGET PROFIT 45

     

    c1 unc2 sind von der Struktur immer gleich ich teste nur verschiedene Formen. Ich teste mit der Börsensoftware investox,bei dieser braucht man keine Programmierkenntnisse.
    Ich hoffe das hilft Ihnen.
    Gruss und Danke
    Adrian

    #15435 quote
    adrian
    Participant
    New

    hallo Herr Nicolas,

    habe den Code mit ihrer Hilfe und dem Forum nochmal neu geschrieben.Jetzt geht es!vielen Dank

    Ggruss ,Danke
    Adrian

    #15438 quote
    Nicolas
    Keymaster
    Master

    Wenn ich Ihre Strategie richtig verstehe, sollte Ihr Code wie folgt modifiziert werden:

    DEFPARAM FLATBEFORE=800000
    DEFPARAM FLATAFTER=220000
    DEFPARAM CumulateOrders = False
    if intradaybarindex=0 then
    traded=0
    endif
    // open long Kondition=close higher then the highest close of the50 past close
    c1=close crosses over highest[50](high)[1]
    IF c1 and traded=0 THEN
    BUY 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    // open short Kondition =open lower then the lowest open of the 50 past open
    c2=close crosses under lowest[50](low)[1]
    IF c2 and traded=0 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    traded=1
    ENDIF
    SET STOP LOSS 85
    SET TARGET PROFIT 45
    #15441 quote
    adrian
    Participant
    New

    Genau so ist es.
    Aber ich möchte enterlong basis highest[50](high)[1] und nicht erst warten bis intradaybar abgeschlossen ist.
    Vis versa für shortposition.
    Geht das?

    Adrian

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

Codesyntax bei nur einem Trade pro Tag


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
adrian @adrian Participant
Summary

This topic contains 9 replies,
has 2 voices, and was last updated by adrian
9 years, 3 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 10/19/2016
Status: Active
Attachments: No files
Logo Logo
Loading...