TS su supporti e resistenze

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #107857 quote
    agamennone m
    Participant
    Junior

    ciao,qualcuno è riuscito a creare un trading system che utilizza supporti e resistenze?

    #107865 quote
    robertogozzi
    Moderator
    Master

    Questo è un esempio di strategia che acquista/vende sui Pivot https://www.prorealcode.com/topic/ordini-su-livelli-predeterminati/#post-62936.

    Puoi modificarla prendendo altri spunti da quello che sicuramente, in italiano o inglese, troverai sul forum.

    #107898 quote
    agamennone m
    Participant
    Junior

    Ciao Roberto,grazie mille per la risposta, ho trovato il seguente indicatore che mi piace,come posso utilizzarlo per comprare e vendere nei pressi di queste linee?

    DEFPARAM CalculateOnLastBars = 350 // To calculate the lines swing we take into consideration only the latest X candles
     
    n = 50 // highest and lowest period for support/resistance fetch
    tolerance = 5// should be expressed in points) if there are two (or more) lines that are close to me, then you have to draw a center line
    lookback = 10 // period lookback to confirm support and resistance areas
    showSupport = 1//(0=false , 1=true)
    showResistance = 1 //(0=false , 1=true)
     
    once linear = 0
    once lineas = 0
    once newlinear = 0
    once newlineas = 0
    once newlinearr = 0
    once newlineass = 0
     
    if showResistance then
    resistance = highest[n](high) // resistance ( massimi precedenti dove i prezzi sono stati respinti)
     
    if resistance[n-lookback] = resistance[1] then
    linear = (resistance[1] + linear) / 2
    else
    linear = linear
    endif
     
    if linear[2] = linear[1] and linear[1] = linear then
    newlinear = linear
    endif
     
    i = 0
    valsup = newlinear + tolerance*pointsize
    valinf = newlinear - tolerance*pointsize
     
    while i <> 350 do
    if newlinear[i] = 0 then//aiuta ad accorciare il ciclo
    break
    endif
    cond = (newlinear[i] <= valsup and newlinear[i] >= valinf) or (newlineas[i] <= valsup and newlineas[i] >= valinf)
    if cond then
    newlinearr = (newlinear[i] + newlinear)/2
    savedbar = barindex//[i]
    endif
    i = i+1
    wend
     
    drawhline(newlinearr) coloured(0,125,255)
    if newlinearr<>oldtextr then
    drawtext("▼ #newlinearr#",savedbar,newlinearr)
    oldtextr=newlinearr
    endif
    endif
     
    if showSupport then
    support = lowest[n](low) // support ( minimi precedenti dove i prezzi sono stati rimbalzati)
     
    if support[n-lookback] = support[1] then
    lineas = (support[1] + lineas) / 2
    else
    lineas = lineas
    endif
     
    if lineas[2] = lineas[1] and lineas[1] = lineas then
    newlineas = lineas
    endif
     
    i = 0
    valsup = newlineas + tolerance*pointsize
    valinf = newlineas - tolerance*pointsize
     
    while i <> 350 do
    if newlineas[i] = 0 then//aiuta ad accorciare il ciclo
    break
    endif
    cond = (newlineas[i] <= valsup and newlineas[i] >= valinf) or (newlinear[i] <= valsup and newlinear[i] >= valinf)
    if cond then
    newlineass = (newlineas[i] + newlineas)/2
    savedbar = barindex[i]
    endif
    i = i+1
    wend
     
    drawhline(newlineass) coloured(0,125,255)
    if newlinearr<>oldtexts then
    drawtext("▲ #newlineass#",savedbar,newlineass)
    oldtexts=newlineass
    endif
    endif
     
    RETURN
    
    #107915 quote
    Nicolas
    Keymaster
    Master

    Cosa intendi con "compra o vendi vicino ai livelli"? Non vuoi che il prezzo tocchi un supporto o una resistenza per innescare un ordine ??

    #108003 quote
    agamennone m
    Participant
    Junior

    diciamo che mi andrebbe bene anche con un leggero margine(se fattibile) se no al tocco…

    #108324 quote
    agamennone m
    Participant
    Junior

    dovrei scrivere qualcosa tipo:

    newlinearr=call"indicatore"
    
    c1= close crosses over newlinearr
    
    if c1 than
    
    buy 1 contract at market

    mi dice che l’indicatore non produce valori validi..

    #108514 quote
    Nicolas
    Keymaster
    Master

    Sì, l'indicatore disegna le linee, ma non invia alcun valore. Sei sicuro della strategia? Perché le linee che vedi nella cronologia sono linee tracciate perché il prezzo le ha rifiutate. So che nei forum c'è lo stesso indicatore che restituisce le ultime 10 righe nelle sue istruzioni RETURN, andrebbe bene se riuscissi a trovarlo, perché non ricordo dove sia! 🙂

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

TS su supporti e resistenze


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by Nicolas
6 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 09/17/2019
Status: Active
Attachments: No files
Logo Logo
Loading...