Brakeout candela

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #124506 quote
    SirobiSirobi
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    SirobiSirobi
    Participant
    Junior

    Grazie Roberto.

    A presto

    #124530 quote
    SirobiSirobi
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
6 years, 6 months ago.

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