STOP-LOSS di vollatiltà

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #237377 quote
    andrea trevisanandrea trevisan
    Participant
    Average

    Ho creato un indicatore sul grafico che imposti in automatco il livello di Stop-loss sul grafico, mi sembra di aver scritto il codice correttamente ma non mi appare nulla sul grafico.

    Riporto il codice:

    defparam CALCULATEONLASTBARS = 1  (questo lo inserito per avere solo l’ultimo dato e non tutto lo storico)

    La variabile “X” mi servve perché a volte devo calcolare lo stop sulla candela già chiusa (vale come storico)

    La variabile “Q” la uso per distinguere lostop su un segnale long o short
    ////////massimo minimo su candela segnale/////
    Myhigh = ABS(high[X])
    Mylow = abs(low[X])

    ////////////stop-loss di volatilità basato su ATR////////
    Myatr = ABS(AverageTrueRange[200](close)/2
    Sellstop = (Myhigh + Myatr)
    Buystop = (Mylow – Myatr)

    //////Stop segnale long///////
    If Q = 1 THEN
    drawtext (“Stop-loss – #Buystop#”,barindex,Buystop)coloured(200,0,0) (non mi appare nulla sul grafico credo sia qui l’errore)
    endif

    /////stop segnale short//////
    if Q = 0 THEN
    drawtext (“Stop-loss – #Sellstop#”,barindex,Sellstop)coloured(200,0,0)
    endif
    return

    #237388 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Mancano le variabili X e Q e segnala un sacco di errori, ti spiace allegare il file ITF?

    #237397 quote
    andrea trevisanandrea trevisan
    Participant
    Average
    #237422 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Devi togliere la riga:

    defparam CALCULATEONLASTBARS =1

    Se il risultato sono troppe scritte sul grafico, aggiungi come prima riga:

    DEFPARAM DrawOnLastBarOnly = True
    Iván González thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

STOP-LOSS di vollatiltà


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/09/2024
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...