Stop-Loss con Min/Max precedenti

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #136085 quote
    Maurizio A.
    Participant
    Average

    Buongiorno a tutti, vorrei immettere in una strategy il valore di stop-loss che corrisponda alla differenza del prezzo di ingresso con il  valore di MAX (x trade short) o MIN (x trade long) di precedenti N barre. RINGRAZIO ANTICIPATAMENTE !

    #136086 quote
    robertogozzi
    Moderator
    Master

    Eccolo, con i valori min/max delle ultime 10 barre:

    //Long
    If MieCondizioniLong  and not OnMarket then
       Buy 1 contract at market
       Set Stop Loss abs(close - lowest[10](low))
    Endif
    //Short
    If MieCondizioniShort and not OnMarket then
       SellShort 1 contract at market
       Set Stop Loss abs(close - highest[10](high))
    Endif
    #136104 quote
    Maurizio A.
    Participant
    Average

    quindi il valore in pips dello SL è pari a abs(close highest[10](high))/pipsize ?

    Grazie Roberto ! gentilissimo !

    #136126 quote
    robertogozzi
    Moderator
    Master

    Si, in realtà li è espresso come differenza di prezzo, ad esempio 0.0040, perché LOSS vuole questo, quindi PIPSIZE devi toglierlo.

    Se, invece, tu volessi usare PIPSIZE, devi allora usare PLOSS, che richiede una differenza in Pips invece che in prezzo.

    #136137 quote
    Maurizio A.
    Participant
    Average

    tutto molto chiaro, GRAZIE ROBERTO

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

Stop-Loss con Min/Max precedenti


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Maurizio A. @mau973 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Maurizio A.
5 years, 8 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/16/2020
Status: Active
Attachments: No files
Logo Logo
Loading...