VWAP uscita al tocco di una banda

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #211687 quote
    Edisone
    Participant
    Average

    Buonagiorno,

    semplice strategia intraday con entry quando il supertrend è long (con filtro tempo), uscita al tocco della banda Superiore SDup3

    Non risco ad impostare l’uscita. Chiedo aiuto.

    Grazie

     

    DEFPARAM CumulateOrders=False
    ///////////////////////////////////////////////////////////////////
    // Anular todas las órdenes pendientes y cerrar todas las posiciones a la hora "FLATAFTER"
    DEFPARAM FLATAFTER = 220000
    Time1 = 083000
    Time2 = 110000
    Time3 = 153000
    Time4 = 173000
    If (time >= Time1 and time <= Time2) Then
    tt1=1
    else
    tt1=0
    endif
    
    If (time >= Time3 and time <= Time4) Then
    tt2=1
    else
    tt2=0
    endif
    
    ///////////////////////////////////////////////////////////////////
    // Condiciones para entrada de posiciones largas
    var1=3
    var2=10
    indicator1 = close
    indicator2 = SuperTrend[var1,var2]
    c1 = (indicator1 >= indicator2)
    
    IF NOT LONGONMARKET and c1 and (tt1=1 or tt2=1) THEN
    BUY 1 SHARES AT MARKET
    ENDIF
    
    ///////////////////////////////////////////////////////////////////
    //PRC_VWAP intraday
    //07.09.2016
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    d = max(1, intradaybarindex)
    
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    if(intradaybarindex=0) then
    sd = 0
    else
    sd = SUMMATION[d](max(abs(high-vwap),abs(vwap-low)))/d
    endif
    
    SDup1 = vwap+sd
    SDlw1 = vwap-sd
    SDup2 = vwap+sd*2
    SDlw2 = vwap-sd*2
    SDup3 = vwap+sd*3
    SDlw3 = vwap-sd*3
    ///////////////////////////////////////////////////////////////////
    
    // Condizione d'uscita 1
    cond1=0
    IF (high CROSSES OVER SDup3) Then
    cond1=1
    ENDIF
    
    ///////////////////////////////////////////////////////////////////
    // Condiciones de salida 
    indicator3 = close
    indicator4 = SuperTrend[var1,var2]
    c2 = (indicator3 <= indicator4)
    ///////////////////////////////////////////////////////////////////
    
    // uscita quando il Massimo tocca la banda SDup3
    IF LONGONMARKET and cond1 THEN
    SELL AT MARKET
    ENDIF
    
    GRAPHONPRICE SDup3
    #211694 quote
    robertogozzi
    Moderator
    Master

    Vedo che l’uscita l’hai messa, che problema ti da?

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

VWAP uscita al tocco di una banda


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Edisone @edisone Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
2 years, 10 months ago.

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