Limit buy auf close einer Zeit

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #121237 quote
    phoentzs
    Participant
    Master

    Hallo,

    wenn ich eine Limit buy Order auf ein close – nPips einer Kerze einer bestimmten Uhrzeit eine festgelegte lang Zeit setzen will… wie mache ich das?

    also:

    Time=170000

    20 Pips unter Close dieser Kerze

    bis Time=220000

     

    Vielen Dank

    #121250 quote
    robertogozzi
    Moderator
    Master

    Versuchen Sie dieses (nicht getestet):

    IF time = 170000 THEN
       EntryPrice = close - 20 * pipsize
    ENDIF
    IF time >= 170000 AND time <= 220000 THEN
       BUY 1 CONTRACT AT EntryPrice LIMIT
    ENDIF
    phoentzs thanked this post
    #121298 quote
    phoentzs
    Participant
    Master

    Das funktioniert schonmal. Danke dafür.

    Aber wie kann ich zu der Bedingung noch einen Indikator hinzufügen? Speziell wenn das close der bestimmte Kerze über/unter dem Pivot Point liegt?

    Meine Variante funktioniert irgendwie nicht. Das System soll wenn die 085500 Kerze überm Pivot liegt long handeln und short umgekehrt.

    Die Codierung des Pivot nimmt er so nicht.

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    defparam flatafter = 173000
    
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    ONCE TradeLong  = 1
    ONCE TradeShort = 1
    IF IntraDayBarIndex = 0 THEN
    TradeLong  = 1
    TradeShort = 1
    ENDIF
    
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = (DHigh(1) + DLow(1) + DClose(1))/3
    c1 = (close > indicator1)
    
    IF time = 085500 and c1 THEN
    EntryPrice = close + 50 * pipsize
    ENDIF
    
    IF not onmarket and time >= 090000 AND time <= 170000 and not daysforbiddenentry and tradelong THEN
    BUY 1 CONTRACT AT EntryPrice limit
    tradelong = 0
    ENDIF
    
    
    // Bedingungen zum Einstieg in Short-Positionen
    indicator2 = (DHigh(1) + DLow(1) + DClose(1))/3
    c2 = (close < indicator2)
    
    IF time = 085500 and c2 THEN
    EntryPrice = close - 50 * pipsize
    ENDIF
    
    IF not onmarket and time >= 090000 AND time <= 170000 and not daysforbiddenentry and tradeshort THEN
    sellshort 1 CONTRACT AT EntryPrice limit
    tradeshort = 0
    ENDIF
    
    SET TARGET pPROFIT 60
    SET STOP   pLOSS   20

     

    Hier meine Rohfassung:

    #121303 quote
    robertogozzi
    Moderator
    Master

    Dies liegt an den Zeilen 26 und 40. Sie werden auf 0 gesetzt, wodurch der Handel deaktiviert wird, wenn Sie die ausstehende Bestellung aufgeben, ohne sicher zu sein, dass sie ausgelöst wird oder nicht. Sie sollten den Handel deaktivieren, wenn Sie entweder LongOnMarket oder ShortOnMarket sind. Entfernen Sie die Zeilen 26 und 40 und fügen Sie diese Zeilen in Zeile 14 hinzu:
    [scode]
    If LongOnMarket Then
    TradeLong = 0
    Endif
    If ShortOnMarket Then
    TradeShort = 0
    Endif
    [/scode]

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

Limit buy auf close einer Zeit


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 11 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 03/05/2020
Status: Active
Attachments: No files
Logo Logo
Loading...