Brakeout candela

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #124506 quote
    Sirobi
    Participant
    Junior

    Buongiorno ragazzi,

    avrei bisogno di un aiuto. Vorrei testare la seguente strategia :

    acquisto quando candela giapponese è verde; SL = minimo candela precedente o 1%; TP = massimo candela precedente o 2%; Trailing stop attivato dal 1%

    Grazie per chi mi darà una mano a scrivere il codice della strategia

    #124516 quote
    robertogozzi
    Moderator
    Master

    Purtroppo NON si possono indicare due diversi tipi di STOP LOSS (nel tuo caso Stop Loss e Trailing Stop), ma solo uno.

    O, meglio, se ne possono indicare quanti ne vuoi, ma prenderà per buono l’ultimo trovato.

    Nell’esempio ho messo le barre iniziali sul TRAILING in modo che usi solo STOP LOSS, se vuoi puoi invertire le barre, toglierle da TRAILING e metterle alla riga sotto:

    DEFPARAM CumulateOrders = fasle
    IF close > open AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
       SET TARGET %PROFIT   2
       //SET STOP %TRAILING 1
       SET STOP   %LOSS     1
    ENDIF
    #124525 quote
    Sirobi
    Participant
    Junior

    Grazie Roberto.

    A presto

    #124530 quote
    Sirobi
    Participant
    Junior

    Per favore ancora un piccolo aiuto : vorrei chiudere la posizione di buy dopo 3 barre. Come posso tradurlo in codice ?

    Grazie in anticipo

    #124555 quote
    robertogozzi
    Moderator
    Master

    Ecco:

    IF LongOnMarket AND (BarIndex - TradeIndex) = 3 THEN
       SELL AT MARKET
    ENDIF
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Brakeout candela


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Sirobi @sirobi Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 10 months ago.

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