MACD MTF Problem, falsche Werte?

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

    Hallo,

    ich habe hier ein relativ simples Dax Eröffnung Programm erstellt. Was auch eine gute Performance liefert, aber in der Nachkontrolle der Trades ist mir aufgefallen, das die Richtung nicht immer mit dem MACD H4 MTF übereinstimmt.

    Die Limitorders in M5 sollen aufgegeben werden, aufgrund der Richtung die der MACD H4 MTF (bar 05000-09000) vorgibt.

    Das funktioniert aber nicht immer. Liegt es daran, dass die H4-bar noch nicht beendet ist, wenn ich 0855 die Richtung abfrage?

    Oder wo liegt mein Problem? Kann mir jemand helfen?

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    defparam preloadbars = 10000
    defparam flatafter = 190000
    
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    
    timeframe(4 hour, updateonclose)
    // Bedingungen zum Einstieg in Long-Positionen
    indicator11 = MACDline[12,26,9](close)
    indicator22 = ExponentialAverage[9](MACDline[12,26,9](close))
    c3 = (indicator11 > indicator22)
    
    // Bedingungen zum Einstieg in Short-Positionen
    indicator33 = MACDline[12,26,9](close)
    indicator44 = ExponentialAverage[9](MACDline[12,26,9](close))
    c4 = (indicator33 < indicator44)
    
    timeframe(5 minute, updateonclose)
    
    c1 = (close > entrypricel)
    c2 = (close < entryprices)
    
    //long
    IF time = 085500 and c3 THEN
    EntryPricel = close - 30 * pipsize
    ENDIF
    
    IF not onmarket and time >= 090000 AND time <= 100000 and c1 and not daysforbiddenentry THEN
    BUY 1 CONTRACT AT EntryPricel limit
    SET TARGET %PROFIT 1.15
    SET STOP   %LOSS   0.85
    ENDIF
    
    
    //short
    IF time = 085500 and c4 THEN
    EntryPrices = close + 40 * pipsize
    ENDIF
    
    IF not onmarket and time >= 090000 AND time <= 100000 and c2 and not daysforbiddenentry  THEN
    sellshort 1 CONTRACT AT EntryPrices limit
    SET TARGET %PROFIT 1.45
    SET STOP   %LOSS   0.75
    ENDIF
    
    //************************************************************************
    //trailing stop function
    trailingstart = 36            //50   trailing will start @trailinstart points profit
    trailingstep  = 2             //9  trailing step to move the "stoploss"
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    #135239 quote
    Hico
    Participant
    Average

    Hallo,

    ja es liegt daran das quasi jeder tf nur einmal aufgerufen/aktualisiert wird.

    Ergo arbeitet das Handdelssystem immer mit dem MACD Wert von der vorigen 4h Periode.

    Was das ganze irgendwie sinnlos macht.

     

    Ich hätte auch gerne eine Erklärung dafür

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

MACD MTF Problem, falsche Werte?


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Hico
5 years, 8 months ago.

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