Trading system "Universal"

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #6967 quote
    Max
    Participant
    Average

    Qui di seguito una domanda inviata a ProRealTime :

    buongiorno
    avrei bisogno di scrivere un trading sistem che operasse sulla base di questo indicatore UNIVERSAL.
    vorrei che se il valore di questo indicatore e maggiore di 0, il sistema compri una posizione e se invece l’indicatore e minore di 0 venda 1 posizione, stop e target l’inserisco successivamente con stop loss e take profit

    // Funzione : UNIVERSAL
    //-------------------------------------------------------------------------
    bandedge= 20
    whitenoise= (Close - Close[2])/2
    
    if barindex>bandedge then
    // super smoother filter
    a1= Exp(-1.414 * 3.14159 / bandedge)
    b1= 2*a1 * Cos(1.414*180 /bandedge)
    c2= b1
    c3= -a1 * a1
    c1= 1 - c2 - c3
    filt= c1 * (whitenoise + whitenoise[1])/2 + c2*filt[1] + c3*filt[1]
    
    filt1 = filt
    
    if ABS(filt1)>pk[1] then
    pk = ABS(filt1)
    else
    pk = 0.991 * pk[1]
    endif
    
    if pk=0 then
    denom = -1
    else
    denom = pk
    endif
    
    if denom = -1 then
    result = result[1]
    else
    result = filt1/pk
    endif
    endif
    
    RETURN result COLOURED(66,66,255) as "Universal Oscillator", 0 as "0"

     

    E un esempio di risposta :

    // Funzione : UNIVERSAL
    //-------------------------------------------------------------------------
    bandedge= 20
    whitenoise= (Close - Close[2])/2
    
    if barindex>bandedge then
    // super smoother filter
    a1= Exp(-1.414 * 3.14159 / bandedge)
    b1= 2*a1 * Cos(1.414*180 /bandedge)
    c2= b1
    c3= -a1 * a1
    c1= 1 - c2 - c3
    filt= c1 * (whitenoise + whitenoise[1])/2 + c2*filt[1] + c3*filt[1]
    
    filt1 = filt
    
    if ABS(filt1)>pk[1] then
    pk = ABS(filt1)
    else
    pk = 0.991 * pk[1]
    endif
    
    if pk=0 then
    denom = -1
    else
    denom = pk
    endif
    
    if denom = -1 then
    result = result[1]
    else
    result = filt1/pk
    endif
    endif
    
    c1= not longonmarket and result > 0
    if c1 then
    buy 1 share at market
    endif
    
    c2=not shortonmarket and result < 0
    if c2 then
    sellshort 1 share at market
    endif
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Trading system "Universal"


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Max @max Participant
Summary

This topic contains 1 voice and has 0 replies.

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