non operare per le prossime 5 barre

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17747 quote
    gianlox
    Participant
    Senior

    salve, vorrei fare il modo che dopo l’uscita da un trade, al verificarsi di qualsiasi condizione, il sistema non entri long o short per le prossime 5 barre.
    ringrazio in anticipo.

    Gianluca

    #17825 quote
    Nicolas
    Keymaster
    Master

    Credo che qualcosa di simile dovrebbe essere ok:

    if onmarket[1]=1 and onmarket=0 then 
     start = barindex
    endif 
    
    condition = barindex-start>=5


    (Non testato, quindi per favore dirci se si sta lavorando bene per voi, grazie).

    ALE thanked this post
    #20836 quote
    Buongiorno,
    Vorrei inserire ma non riesco in questo sistema trovato nel sito Prorealcode il codice da lei scritto qui sopra per non operare per le prosime 5 Barre.
    
    La ringrazio anticipatamente per la sua cortesia
    Mauro
    DEFPARAM CumulateOrders = FALSE
    DEFPARAM FlatBefore = 080000
    DEFPARAM FlatAfter = 212900
    if (time >=080000 and time < 110000) or (time >= 134500 and time <181400) then
    
     indicator1, ignored = CALL "BLUSTER DAX"
     c1 = (indicator1 >= 1)
    
     IF c1 AND CurrentDayOfWeek <> 1 THEN
      BUY 1 CONTRACT AT MARKET
     ENDIF
    
     indicator2, ignored = CALL "BLUSTER DAX"
     c2 = (indicator2 <= -1)
    
     IF c2  THEN
      SELL  AT MARKET
     ENDIF
    
     indicator3, ignored = CALL "BLUSTER DAX"
     c3 = (indicator3 <= -1)
    
     IF c3 AND  CurrentDayOfWeek <> 1  THEN
      SELLSHORT 1 CONTRACT AT MARKET
     ENDIF
    
     indicator4, ignored = CALL "BLUSTER DAX"
     c4 = (indicator4 >= 1)
    
     IF c4 THEN
      EXITSHORT  AT MARKET
     ENDIF
    
     // TRAILING STOP LOGIK BY KENNETH KVISTAD MODIFIED FOR LONG AND SHORT POSITION
     TGL =47
     TGS= 41
    
     if not onmarket then
      MAXPRICE = 0
      MINPRICE = close
      PREZZOUSCITA = 0
     ENDIF
    
     if longonmarket then
      MAXPRICE = MAX(MAXPRICE,close)
       if MAXPRICE-tradeprice(1)>=TGL*pointsize then
        PREZZOUSCITA = MAXPRICE-TGL*pointsize
       ENDIF
     ENDIF
    
     if shortonmarket then
      MINPRICE = MIN(MINPRICE,close)
       if tradeprice(1)-MINPRICE>=TGS*pointsize then
        PREZZOUSCITA = MINPRICE+TGS*pointsize
       ENDIF
     ENDIF
    
     if onmarket and PREZZOUSCITA>0 then
      EXITSHORT AT PREZZOUSCITA STOP
      SELL AT PREZZOUSCITA STOP
     ENDIF
    
     SET STOP PLOSS 70
     SET TARGET PPROFIT 87
    ENDIF
    
    
    #20850 quote
    ALE
    Moderator
    Master

    HELLO MAURO

    PLEASE FIND THE ATTACHED FILE TO TEST YOUR VERSION, WITH NICOL’S PART OF CODE

    THANKS

    ALE

    #20863 quote

    Ciao Ale,

    sto verificando il sistema da inserito circa 3 mesi fà ( BLUSTER DAX intraday trading strategy ),

    Ma vorrei evitare una volta arrivato a target di rientrare subito nelle barre successive ( poi da verificare il numero di barre successive conle variabili ) semore nella stessa direzione.

    Ciao Mauro

    P.S. purtroppo non sono riuscito aprire il file .itf

    #20866 quote
    ALE
    Moderator
    Master

    CIAO

    IL FILE ITF :

    FAI IL DOWLOAD E POI SEGUI LE ISTRUZIONI DEL LINK SOTTOSTANTE:
    https://www.prorealcode.com/import-export-prorealtime-code-platform/

    #20874 quote

    Ciao,

    Ecco il sistema da qui come ti dicevo prima vorrei evitare una volta arrivato a target di rientrare subito nelle barre successive.

    Grazie

    Mauro

     

    // THIS SIMPLE STRATEGY CATCH PROFIT BY UNIVERSAL INDICATOR
    // IG MARKET GERMANY CASH 1 EUR MINI – SPREAD 1 – 15 M
    DEFPARAM CumulateOrders = FALSE
    DEFPARAM FlatBefore = 080000
    DEFPARAM FlatAfter = 212900
    if (time >=080000 and time < 110000) or (time >= 134500 and time <181400) then
    if onmarket[1]=1 and onmarket=0 then
    start = barindex
    endif

    condition = barindex-start>=5

    indicator1, ignored = CALL “BLUSTER DAX”
    c1 = (indicator1 >= 1)

    IF c1 AND CurrentDayOfWeek <> 1 AND CONDITION THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    indicator2, ignored = CALL “BLUSTER DAX”
    c2 = (indicator2 <= -1)

    IF c2 THEN
    SELL AT MARKET
    ENDIF

    indicator3, ignored = CALL “BLUSTER DAX”
    c3 = (indicator3 <= -1)

    IF c3 AND CurrentDayOfWeek <> 1 AND CONDITION THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    indicator4, ignored = CALL “BLUSTER DAX”
    c4 = (indicator4 >= 1)

    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF

    // TRAILING STOP LOGIK BY KENNETH KVISTAD MODIFIED FOR LONG AND SHORT POSITION
    TGL =47
    TGS= 41

    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF

    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=TGL*pointsize then
    PREZZOUSCITA = MAXPRICE-TGL*pointsize
    ENDIF
    ENDIF

    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close)
    if tradeprice(1)-MINPRICE>=TGS*pointsize then
    PREZZOUSCITA = MINPRICE+TGS*pointsize
    ENDIF
    ENDIF

    if onmarket and PREZZOUSCITA>0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF

    SET STOP PLOSS 70
    SET TARGET PPROFIT 87
    ENDIF
    // REGARDS ALE

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

non operare per le prossime 5 barre


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
gianlox @gianlox Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by Mauro T. “Algorithm System”
9 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/03/2016
Status: Active
Attachments: No files
Logo Logo
Loading...