Strategia su indicatore custom

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

    Ciao a tutti

    Sto imparando, quindi chiedo scusa in anticipo per le domande “banali”

    Sto provando a inserire un indicatore customizzato preso dal forum qui : https://www.prorealcode.com/prorealtime-indicators/vwap-intraday/ nella mia strategia

    Il codice che ho creato è il seguente (l’ho sintetizzato e tagliato in alcune parti accessorie)

    //Parametri Di Default S&P
    DEFPARAM CumulateOrders = False
    DEFPARAM FLATBEFORE = 163000
    DEFPARAM FLATAFTER = 220000
    //Parametri Di Default DAX
    //DEFPARAM FLATBEFORE = 100000
    //DEFPARAM FLATAFTER = 170000
    
    //Indicatori utilizzati
    adxc=adx[adxperiod]
    
    d = max(1, barindex) //vwap + standard dev bands
    vwap = summation[d](volume*typicalprice)/summation[d](volume)
    if (barindex=0) then
    sd = 0
    else
    sd = summation[d](max(abs(high-vwap),abs(vwap-low)))/d
    endif
    
    
    //SDup2 = vwap+sd*2
    //SDup3 = vwap+sd*3
    SDlw2 = vwap-sd*2
    //SDlw3 = vwap-sd*3
    //SDUp4 = vwap+sd*4
    //SDlw4 = vwap-sd*4
    
    //Pattern Detection: Reversal and Doji - VSA
    
    //avolume = wilderaverage[volperiod](volume)
    
    
    if low < SDlw2 AND adxc < 25 then
    buy 1 contracts at market
    endif
    
    SET STOP PTRAILING 5
    
    SET TARGET PPROFIT 30

    Per adesso ho commentato tutte le altre bande del vwap solo per provare a comprare il “tocco” della SDlw2, ma il sistema non produce risultati.

     

    Cosa sbaglio?

    #108067 quote
    Nicolas
    Keymaster
    Master

    Il calcolo che hai fatto di VWAP è sbagliato, penso che tu abbia adattato un calcolo intraday del VWAP alla tua salsa! In questo caso stai calcolando un VWAP su tutte le barre della cronologia, non verrà mai ripristinato. Puoi visualizzarne il valore tracciandolo sul grafico nei backtest:

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

Strategia su indicatore custom


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
carlo__ @carlo__ Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/20/2019
Status: Active
Attachments: No files
Logo Logo
Loading...