No setting orders in real time

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #7272 quote
    Adolfo
    Participant
    Senior

    Hey! Could someone tell me why, a system that works fine in backtest, is not setting orders in real time? Any idea?

    This is the executed code: (DAX 15m chart)

    //-------------------------------------------------------------------------
    // Código principal : ALEX  DAX OK
    //-------------------------------------------------------------------------
    
    
    REM No acumular órdenes
    DEFPARAM CumulateOrders=False
    
    REM Horario de operativa
    DEFPARAM FlatBefore = 090000
    DEFPARAM FlatAfter = 173000
    
    REM Variables
    mm = Exponentialaverage[8](close)
    mm18 = Exponentialaverage[18](close)
    uma = Highest[8](high)
    umb = Lowest[8](low)
    
    REM PARAMETERS
    objetivo = 45*Pipsize
    capital = 1000
    risk = 0.05
    
    REM MONEY MANAGEMENT
    equity = capital+strategyprofit
    maxrisk = round(equity*risk)
    
    REM POSITION SIZE
    PositionSize = abs(round((maxrisk/StopLoss)/PointValue))
    
    REM LAST TOUCH WITH MM8 IN BULLISH MOVEMENT
    IF High[1]>=mm[1] AND Low[1]<=mm[1] AND Low>mm THEN
    ltp = mm[1]
    if uma > mm THEN
    uma = Highest[8](high)
    ENDIF
    IF (uma - ltp) > objetivo THEN
    compra = 1
    ENDIF
    ENDIF
    IF Low<mm then
    compra = 0
    uma = mm
    ENDIF
    
    REM LAST TOUCH WITH MM8 IN BEARISH MOVEMENT
    IF High[1]>=mm[1] AND Low[1]<=mm[1] AND High<mm THEN
    ltp = mm[1]
    if umb < mm then
    umb = Lowest[8](low)
    endif
    IF (ltp - close) > objetivo THEN
    venta = 1
    ENDIF
    ENDIF
    if high>mm then
    venta = 0
    umb = mm
    endif
    
    REM Anticipación a la media móvil en la entrada
    plus = abs(mm - mm[1])
    If compra = 1 then
    BuyPrice = mm+plus
    ELSE
    BuyPrice = 0
    ENDIF
    IF venta = 1 THEN
    SellPrice = mm-plus
    ELSE
    SellPrice = 0
    ENDIF
    
    REM LAST TRADE COUNT
    LastTrade = BarIndex - TradeIndex
    
    REM PROFIT Y STOPS
    PipsProfit = 25
    MinStop = 30
    PresetStop = abs(mm-mm18)/PipSize
    StopLoss = max(PresetStop,MinStop)
    
    
    IF NOT OnMarket THEN
    IF lasttrade>1 THEN
    IF compra=1 THEN
    BUY PositionSize SHARE AT BuyPrice LIMIT
    SET STOP ploss StopLoss
    SET TARGET pPROFIT PipsProfit
    ENDIF
    if venta=1 THEN
    SELLSHORT PositionSize SHARE AT SellPrice LIMIT
    SET STOP pLOSS StopLoss
    SET TARGET pPROFIT PipsProfit
    ENDIF
    ENDIF
    ENDIF
    
    
    No-working.png No-working.png
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

No setting orders in real time


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
Adolfo @adolfo_onrubia Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 05/18/2016
Status: Active
Attachments: No files
Logo Logo
Loading...