Donchian Channel Trading

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #83046 quote
    Nicolas
    Keymaster
    Master

    Diese Version des Codes sollte jetzt die Position bis “maxpos” akkumulieren.
    So erhalten Sie ein Maximum von “maxpos” Position von “n” Größe.

    defparam cumulateorders=true
    
    maxpos = 3
    
    rem long
    C1= Highest[20](High)[1]
    C4=Lowest[10](Low)[1]
    n=(capital*c2)/(close-C4)
    capital=10000
    c2=0.01
    c3=AverageTrueRange[10](close)
    
    if not onmarket then 
    count=0
    else
    if countofposition>countofposition[1] then 
    count=count+1
    endif
    endif
    
    // Long Kauf 1
    If not longonmarket then
    BUY n SHARES AT C1 STOP
    ENDIF
    
    if longonmarket and count<maxpos then
    buy n shares at tradeprice(1)+c3 stop
    endif
    
    // STOP / Verkaufsbedingung
    If LONGONMARKET THEN
    SELL AT C4 STOP
    ENDIF
    
    graph count
    #83409 quote
    Frutta
    Participant
    New

    Vielen Dank Nicolas für die Fachliche super Hilfe

    #85442 quote
    Frutta
    Participant
    New

    Servus zusammen,

     

    ich möchte mein Handelssystem weiter optimieren indem ich Handelszeiten hinzufüge gehandelt werden soll ab 9:15 bis 16:30 ab 20:00 sollen alle Orders geschlossen werden Handelstage möchte ich Montag bis Freitag

    ich hab das nach meinem wissen eingefügt aber irgendwie funktioniert das nicht bitte schaut mal drüber ob ihr den Fehler findet.

    Vielen Dank für eure Hilfe

    defparam cumulateorders=true // Kumulieren von Positionen aktiviert
     
    // Stornieren aller pending Orders und Schließen aller Positionen zur "FLATAFTER"-Zeit
    DEFPARAM FLATAFTER = 200000
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
    noEntryBeforeTime = 091500
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen nach einer bestimmten Uhrzeit
    noEntryAfterTime = 163000
    timeEnterAfter = time < noEntryAfterTime
    
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    
    
    
    
    
    maxpos = 3
     
    rem long
    C1= Highest[20](High)[1]
    C4=Lowest[10](Low)[1]
    n=(capital*c2)/(close-C4)
    capital=10000
    c2=0.01
    c3=AverageTrueRange[10](close)
     
    if not onmarket then
    count=0
    else
    if countofposition>countofposition[1] then
    count=count+1
    endif
    endif
     
    // Long Kauf 1
    If not longonmarket AND timeEnterAfter AND not daysForbiddenEntry AND not TimeEnterBefore then
    BUY n SHARES AT C1 STOP
    ENDIF
     
    if longonmarket and count<maxpos then
    buy n shares at tradeprice(1)+c3 stop
    endif
     
    // STOP / Verkaufsbedingung
    If LONGONMARKET THEN
    SELL AT C4 STOP
    ENDIF
     
    graph count
    
Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Donchian Channel Trading


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
Frutta @frutta Participant
Summary

This topic contains 17 replies,
has 3 voices, and was last updated by Frutta
7 years, 2 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 10/30/2017
Status: Active
Attachments: 8 files
Logo Logo
Loading...