continui messaggi di strategia fallita e blocco degli ordini a mercato su algo

Viewing 14 posts - 16 through 29 (of 29 total)
  • Author
    Posts
  • #175047 quote
    Steven11Steven11
    Participant
    Average

    ciao non è un problema ma ti ripeto non funziona per i trailing stop, è quello il problema se non ti ferma le operazioni quando deve farlo (IG Markets) lo usi anche tu?

    #175050 quote
    tundercuttundercut
    Participant
    Senior

    Sul trailing stop e sullo stop ci posso lavorare, il problema al momento è che non mi apre le posizioni mentre dal back test risulta eseere entrato, e non so il perchè.

    #175055 quote
    Steven11Steven11
    Participant
    Average

    è normale nei backtest ti fa sempre entrare, ma in reale applicano delle restrizioni meschine e scorrette, è una vergogna! se loro hanno un accordo commerciale con Prorealtime dovrebbero rispettare i prodotti di Prorealtime e seppure voler porre delle distanze minime a cui posizionare gli ordini di vendita stop dirlo anticipatamente e dire come fare affinchè l’ordine entri in questo modo i trailing non si possono utilizzare perchè puoi capirlo quando IG rifiuta l’ordine l’algo continua a girare.

    #175056 quote
    Steven11Steven11
    Participant
    Average

    lo hai messo in reale? se non è entrato è perchè non c’erano le condizioni per entrare seconda la tecnica su cui è impostato.

    #175057 quote
    tundercuttundercut
    Participant
    Senior

    Si l’ho messo in reale, dal back test risulta che da giovedi a ieri avrbbe dovuto aprire due posizioni, ma in real non è entrato. Per questo ti ho chiesto se hai fatto qualche modifica rispetto all algo che hai postato.

    #175058 quote
    Steven11Steven11
    Participant
    Average

    a me è entrato 1 volte su GBPYEN e 2 su USDYEN, adesso ti posto il codice. Fai copia e incolla.

     
    Defparam cumulateorders = false
     
    // TAILLE DES POSITIONS
    n = 1
     
    // PARAMETRES
    // high ratio = few positions
    // AUD/JPY : ratio = 0.5 / SL = 0.8 / TP = 1.2 / Period = 12
    // EUR/JPY : ratio = 0.6 / SL = 1 / TP = 0.8 / Period = 8
    // GBP/JPY : ratio = 0.5 / SL = 0.6 / TP = 1 / Period = 8
    // USD/JPY : ratio = 0.5 / SL = 1 / TP = 0.8 / Period = 12
     
    ratio = 0.5
     
    // HORAIRES
    startTime = 210000
    endTime = 231500
    exitLongTime = 210000
    exitShortTime = 80000
     
    // STOP LOSS & TAKE PROFIT (%)
    SL = 0.4
    TP = 0.7
    
    Period = 3
     
    // BOUGIE REFERENCE à StartTime
    if time = startTime THEN
    amplitude = highest[Period](high) - lowest[Period](low)
    ouverture = close
    endif
     
    // LONGS & SHORTS : every day except Fridays
    // entre StartTime et EndTime
    if time >= startTime and time <= endTime and dayOfWeek <> 5 then
    buy n shares at ouverture - amplitude*ratio limit
    sellshort n shares at ouverture + amplitude*ratio limit
    endif
     
    // Stop Loss & Take Profit
    set stop %loss SL
    set target %profit TP
     
    // Exit Time
    if time = exitLongTime then
    sell at market
    endif
    if time = exitShortTime then
    exitshort at market
    endif
    #175059 quote
    tundercuttundercut
    Participant
    Senior

    ok grazie , lo proverò e ti farò sapere.

    #175060 quote
    Steven11Steven11
    Participant
    Average

    quello modificato è questo ma per i problemi di cui ti parlavo non prende i trailing con IG Markets

    #175061 quote
    Steven11Steven11
    Participant
    Average

    questo

    Defparam cumulateorders = false
     
    // TAILLE DES POSITIONS
    n = 1
     
    // PARAMETRES
    // high ratio = few positions
    // AUD/JPY : ratio = 0.5 / SL = 0.8 / TP = 1.2 / Period = 12
    // EUR/JPY : ratio = 0.6 / SL = 1 / TP = 0.8 / Period = 8
    // GBP/JPY : ratio = 0.5 / SL = 0.6 / TP = 1 / Period = 8
    // USD/JPY : ratio = 0.5 / SL = 1 / TP = 0.8 / Period = 12
     
    ratio = 0.6
    period = 8
     
    // HORAIRES
    startTime = 210000
    endTime = 231500
    exitLongTime = 210000
    exitShortTime = 80000
     
     
    // BOUGIE REFERENCE à StartTime
    if time = startTime THEN
    amplitude = highest[Period](high) - lowest[Period](low)
    ouverture = close
    endif
     
    // LONGS & SHORTS : every day except Fridays
    // entre StartTime et EndTime
    if time >= startTime and time <= endTime and dayOfWeek <> 5 then
    buy n shares at ouverture - amplitude*ratio limit
    sellshort n shares at ouverture + amplitude*ratio limit
    endif
     
    // Stop Loss & Take Profit
    // Stop e target
    SET STOP PLOSS 25
    SET TARGET PPROFIT 13 //395
     
    //
    //trailing stop function
    //************************************************************************
    //     trailing stop function
    trailingstart = 19  //10   trailing will start @trailinstart points profit
    trailingstep  = 24   //5    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 HIGH-tradeprice(1)>=trailingstart*pipsize THEN                 //close --> HIGH
    newSL = tradeprice(1)+trailingstep*pipsize
    //  new coding
    IF newSL > close THEN                                                  //if current closing price is < new SL then exit IMMEDIATELY!
    SELL AT newSL LIMIT
    ENDIF
    //  end new coding
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    //  new coding
    IF newSL > close THEN                                                  //if current closing price is < new SL then exit IMMEDIATELY!
    SELL AT newSL LIMIT
    ENDIF
    //  end new coding
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-LOW>=trailingstart*pipsize THEN                 //close --> LOW
    newSL = tradeprice(1)-trailingstep*pipsize
    //  new coding
    IF newSL < close THEN                                                     //if current closing price is > new SL then exit IMMEDIATELY!
    EXITSHORT AT newSL LIMIT
     
    ENDIF
    //  end new coding
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    //  new coding
    IF newSL < close THEN                                                    //if current closing price is > new SL then exit IMMEDIATELY
    EXITSHORT AT MARKET
    ENDIF
    //  end new coding
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL      AT newSL STOP
    EXITSHORT AT MARKET
    ENDIF
     
    // Exit Time
    if time = exitLongTime then
    sell at market
    endif
    if time = exitShortTime then
    exitshort at market
    endif
    #175062 quote
    Steven11Steven11
    Participant
    Average

    alla voce ratio metti 0.3 mentre a quella period metti 3 periodi

    #175325 quote
    murre87murre87
    Participant
    Senior
    #175537 quote
    tundercuttundercut
    Participant
    Senior

    Ciao Roberto, scusa il disturbo, ma perchè la strategia  in questione , quello senza trailing stop, a me sui cross monetari non mi apre le posizioni ? Ho messo in demo la strategia sugli indici e funziona perfettamente mentre sul forex non mi apre posizione ( il back test dice il contrario) , come mai? Cosa c’è di sbagliato? Devo fare qualche settaggio particolare ?

    Grazie.

    #177322 quote
    Hary TradingHary Trading
    Participant
    New

    BUONASERA,

    POTRESTE AIUTARMI A LEGGERE IL CODICE POSTATO DAL SIG.STEVEN11?
    ARRIVO A COMPRENDERE POCHE RIGHE POI MI PERDO 😉

    GRAZIE

    #177324 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    @Hary Trading

    Per favore non scrivere tutto maiuscolo, se non in rare occasioni e per poche parole da enfatizzare.

    È equiparato ad URLARE in una discussione ed è poco educato.

    Grazie.

    Quanto al codice, dopo esserti letto bene il manuale ed avere visto qualche video, qui sul forum o sul canale YouTube di ProRealTime Italia, dovrai porre una domanda specifica su qualche riga che non riesci a comprendere.

    Non è possibile spiegarti tutto un codice, occorrerebbe un corso!

Viewing 14 posts - 16 through 29 (of 29 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

continui messaggi di strategia fallita e blocco degli ordini a mercato su algo


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Steven11 @steven11 Participant
Summary

This topic contains 28 replies,
has 5 voices, and was last updated by robertogozzirobertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 08/03/2021
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...