ts con prorealtime

Collapse
X
 
  • Ora
  • Show
Clear All
new posts
  • planta
    Member

    • Oct 2013
    • 39

    #1

    ts con prorealtime

    ciao a tutti,
    qualcuno sa tradurmi in linguaggio beetrade questo ts che usavo con prorealtime? ricordo che funzionava bene su tf intraday e su molti strumenti
    Grazie mille in anticipo

    Defparam cumulateorders = false
    DEFPARAM FlatBefore = 081500
    DEFPARAM FlatAfter = 215500

    n = 1
    RANGE7 = high - low < high[1] - low[1] and high - low < high[2] - low[2] and high - low < high[3] - low[3] and high - low < high[4] - low[4] and high - low < high[5] - low[5] and high - low < high[6] - low[6]

    IF not onmarket and RANGE7 THEN
    alto = highest[10](high)
    basso = lowest[10](low)

    buy n shares at basso limit
    sellshort n shares at alto limit
    ENDIF

    set stop ploss 14/1.5
    set target pprofit 14
  • Andrea Cagalli
    Senior Member
    • Oct 2010
    • 3995

    #2
    Originariamente Scritto da planta
    ciao a tutti,
    qualcuno sa tradurmi in linguaggio beetrade questo ts che usavo con prorealtime? ricordo che funzionava bene su tf intraday e su molti strumenti
    Grazie mille in anticipo

    Defparam cumulateorders = false
    DEFPARAM FlatBefore = 081500
    DEFPARAM FlatAfter = 215500

    n = 1
    RANGE7 = high - low < high[1] - low[1] and high - low < high[2] - low[2] and high - low < high[3] - low[3] and high - low < high[4] - low[4] and high - low < high[5] - low[5] and high - low < high[6] - low[6]

    IF not onmarket and RANGE7 THEN
    alto = highest[10](high)
    basso = lowest[10](low)

    buy n shares at basso limit
    sellshort n shares at alto limit
    ENDIF

    set stop ploss 14/1.5
    set target pprofit 14
    Ciao,
    spero di aver interpretato correttamente le tue istruzioni

    BUY SCRIPT

    Codice:
    # il valore è espresso in euro
    SET STOP_LOSS = 100 
    
    
    # il valore è espresso in euro
    SET TAKE_PROFIT = 100
    
    
    # se vuoi usare il trailing stop commenta la riga sopra e decommenta quelle sotto
    
    
    # il valore è espresso in euro
    # SET TRAILING_STOP = 100 
    
    
    # il valore è espresso in percentuale rispetto al massimo profitto raggiunto
    # SET TRAILING_PERCENT = 10 
    
    
    SET RANGE7 = ((high - low) < (REF (high,1) - REF (low,1))) and ((high - low) < (REF (high,2) - REF (low,2))) and ((high - low) < (REF (high,3) - REF (low,3))) and ((high - low) < (REF (high,4) - REF (low,4))) and ((high - low) < (REF (high,5) - REF (low,5))) and ((high - low) < (REF (high,6) - REF (low,6))) 
    
    
    SET alto = HHV(10)
    SET basso = LLV(10)
    
    
    (CLOSE <= basso) AND RANGE7 AND (TIME >= 815) AND (TIME <= 2155)
    SELL SCRIPT

    Codice:
    #le impostazioni di money management basta metterle nel Buy Script
    
    
    SET RANGE7 = ((high - low) < (REF (high,1) - REF (low,1))) and ((high - low) < (REF (high,2) - REF (low,2))) and ((high - low) < (REF (high,3) - REF (low,3))) and ((high - low) < (REF (high,4) - REF (low,4))) and ((high - low) < (REF (high,5) - REF (low,5))) and ((high - low) < (REF (high,6) - REF (low,6))) 
    
    
    SET alto = HHV(10)
    SET basso = LLV(10)
    
    
    (CLOSE >= alto) AND RANGE7 AND (TIME >= 815) AND (TIME <= 2155)
    Devi solo impostare i valori per il money management.

    Ciao Ciao
    Manuale beeTrader

    Comment

    • planta
      Member

      • Oct 2013
      • 39

      #3
      grazie tante, ora lo provo
      Ciao

      Comment

      • Apocalips
        Senior Member

        • May 2011
        • 2630

        #4
        Oppure se desideri tirare fuori le variabili Take_Profit, Stop_Loss, Time In, Time out in modo da editarle a piacimento dall\'esterno e non dallo script, puoi fare così :

        BUY SCRIPT

        Codice:
        INPUTS: @TakeProfit(100), @StopLoss(100), @TimeIn (900), @TimeOut (2200)
        
         SET TAKE_PROFIT = @TakeProfit
         SET STOP_LOSS =  @StopLoss
          
          
          SET RANGE =  HIGH - LOW
          
          SET RANGE1 = REF(RANGE, 1)
          SET RANGE2 = REF(RANGE, 2)
          SET RANGE3 = REF(RANGE, 3)
          SET RANGE4 = REF(RANGE, 4)
          SET RANGE5 = REF(RANGE, 5)
          SET RANGE6 = REF(RANGE, 6)
         
          SET COND1 = RANGE < MINOF(RANGE1,RANGE2,RANGE3,RANGE4,RANGE5,RANGE6)
          
          SET COND2 = LOW <= LLV(10) 
          
          SET COND3 = (TIME > @TimeIn)  AND (TIME < @TimeOut)
          
          COND1 AND COND2 AND COND3

        SELL SCRIPT

        Codice:
         SET RANGE =  HIGH - LOW  
          SET RANGE1 = REF(RANGE, 1)
          SET RANGE2 = REF(RANGE, 2)
          SET RANGE3 = REF(RANGE, 3)
          SET RANGE4 = REF(RANGE, 4)
          SET RANGE5 = REF(RANGE, 5)
          SET RANGE6 = REF(RANGE, 6)
         
          SET COND1 = RANGE < MINOF(RANGE1,RANGE2,RANGE3,RANGE4,RANGE5,RANGE6)
          
          SET COND2 = HIGH >= HHV(10)
          
          SET COND3 = (TIME > @TimeIn)  AND (TIME < @TimeOut)
          
          COND1 AND COND2 AND COND3
        Last edited by Apocalips; 20-02-17, 12:47.
        ....non si desidera ciò che è facile ottenere (Ovidio)....

        Comment

        • planta
          Member

          • Oct 2013
          • 39

          #5
          Grazie anche a te Apo,
          stanotte provo a testare
          Ciao
          P.

          Comment

          • planta
            Member

            • Oct 2013
            • 39

            #6
            Ciao a tutti,
            come faccio a far si che questo codice esca comunque entro la chiusura( cioè non stia aperto overnight)?
            Grazie
            Originariamente Scritto da Apocalips
            Oppure se desideri tirare fuori le variabili Take_Profit, Stop_Loss, Time In, Time out in modo da editarle a piacimento dall\'esterno e non dallo script, puoi fare così :

            BUY SCRIPT

            Codice:
            INPUTS: @TakeProfit(100), @StopLoss(100), @TimeIn (900), @TimeOut (2200)
            
             SET TAKE_PROFIT = @TakeProfit
             SET STOP_LOSS =  @StopLoss
              
              
              SET RANGE =  HIGH - LOW
              
              SET RANGE1 = REF(RANGE, 1)
              SET RANGE2 = REF(RANGE, 2)
              SET RANGE3 = REF(RANGE, 3)
              SET RANGE4 = REF(RANGE, 4)
              SET RANGE5 = REF(RANGE, 5)
              SET RANGE6 = REF(RANGE, 6)
             
              SET COND1 = RANGE < MINOF(RANGE1,RANGE2,RANGE3,RANGE4,RANGE5,RANGE6)
              
              SET COND2 = LOW <= LLV(10) 
              
              SET COND3 = (TIME > @TimeIn)  AND (TIME < @TimeOut)
              
              COND1 AND COND2 AND COND3

            SELL SCRIPT

            Codice:
             SET RANGE =  HIGH - LOW  
              SET RANGE1 = REF(RANGE, 1)
              SET RANGE2 = REF(RANGE, 2)
              SET RANGE3 = REF(RANGE, 3)
              SET RANGE4 = REF(RANGE, 4)
              SET RANGE5 = REF(RANGE, 5)
              SET RANGE6 = REF(RANGE, 6)
             
              SET COND1 = RANGE < MINOF(RANGE1,RANGE2,RANGE3,RANGE4,RANGE5,RANGE6)
              
              SET COND2 = HIGH >= HHV(10)
              
              SET COND3 = (TIME > @TimeIn)  AND (TIME < @TimeOut)
              
              COND1 AND COND2 AND COND3

            Comment

            • Cagalli Tiziano
              Senior Member
              • Dec 2007
              • 11252

              #7
              Originariamente Scritto da planta
              Ciao a tutti,
              come faccio a far si che questo codice esca comunque entro la chiusura( cioè non stia aperto overnight)?
              Grazie
              Togli tutte e 4 le parentesi tonde nell\'ultima riga di SET in maniera da abilitare il Time IN e OUT.
              A questo punto puoi decidere tu l\'orario di negoziazione
              ..se corri dietro a due lepri, non ne prendi nemmeno una.

              Comment

              • Cagalli Tiziano
                Senior Member
                • Dec 2007
                • 11252

                #8
                a parte il fatto che credo che le condizioni dovrebbero essere al contrario..ma bisognerebbe chiedere a chi lo ha ideato
                ..se corri dietro a due lepri, non ne prendi nemmeno una.

                Comment

                • planta
                  Member

                  • Oct 2013
                  • 39

                  #9
                  Ciao Tiziano, innanzitutto grazie mille per l aiuto.
                  Sulle condizioni ti dirò, a rigore di analisi tecnica dovrebbero essere al contrario, ma se la memoria non mi tradisce( l età avanza &#128515 performa meglio così con un minimo di ottimizzazione rispetto alla versione al contrario.
                  comunque appena ho un attimo rifaccio un backtest e ti faccio sapere qui sul forum
                  Ciao
                  C.
                  Originariamente Scritto da Cagalli Tiziano
                  a parte il fatto che credo che le condizioni dovrebbero essere al contrario..ma bisognerebbe chiedere a chi lo ha ideato

                  Comment

                  • planta
                    Member

                    • Oct 2013
                    • 39

                    #10
                    Non funziona, h tolto parentesi ma non chiude sempre in intraday, a volte chiude il giorno dopo-

                    Originariamente Scritto da Cagalli Tiziano
                    Togli tutte e 4 le parentesi tonde nell\'ultima riga di SET in maniera da abilitare il Time IN e OUT.
                    A questo punto puoi decidere tu l\'orario di negoziazione

                    Comment

                    • planta
                      Member

                      • Oct 2013
                      • 39

                      #11
                      Fermi tuti, sarà stanchezza a sbagliavo qualcosa io. FUNZIONA BENISSINO. Scusate!!!!
                      Originariamente Scritto da planta
                      Non funziona, h tolto parentesi ma non chiude sempre in intraday, a volte chiude il giorno dopo-

                      Comment

                      Working...