Interrompere strategia dopo "n" trade consecutivi perdenti

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #128646 quote
    danistutadanistuta
    Participant
    Senior

    Salve, come posso interrompere una strategia per esempio al verificarsi  di 3 trade perdenti consecutivi?

    Grazie mille.

    #128657 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    Once Conto = 0
    If IntraDayBarIndex = 0 then
       Conto = 0
    Endif
    If STRATEGYPROFIT < STRATEGYPROFIT[1] then
       Conto = Conto + 1
    Elsif STRATEGYPROFIT > STRATEGYPROFIT[1] and Conto < 3 then
       Conto = 0
    Endif
    If MieCondizioni and Not OnMarket and Conto < 3 then
       Buy 1 Contract at market
    Endif

    Un trade è perdente quando STRATEGYPROFIT > STRATEGYPROFIT[1], cioè quando nella candela attuale la strategia risulta < alla candela precedente.

    Basta incrementare un contatore ed azzerarlo se, prima che arrivi a 3 ce n’è una in profitto.

    Il conteggio lo userai come condizione aggiuntiva per entrare, o meno, a mercato.

    Nel mio esempio ho messo che ogni inizio giorno il conto si azzera.

    #128695 quote
    danistutadanistuta
    Participant
    Senior

    Grazie molte, ma ci sarebbe modo proprio di stoppare il trading automatico, in modo che possa arrivare la notifica via mail dello stop?

    #128698 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Tra la riga 6 e la 7 metti queste tre righe:

    IF Conto = 3 THEN
       Quit
    ENDIF
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

Interrompere strategia dopo "n" trade consecutivi perdenti


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
danistuta @danistuta Participant
Summary

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

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