Gestione strategia

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #80491 quote
    traderwin
    Participant
    Average

    Salve buongiorno. Vorrei chiedere come fare ad inserire interno ad una strategia di trading la funzione seguente:

    Se sei long, e si verificano tre candele negative consecutive, esci dalla posizione.

    Ovvio sara’ viceversa per quanto riguarda lo short

    Allego una foto in modo tale da esser piu’ chiaro possibile.

    Grazie tante[attachment file=”exit long.png”]
    [attachment file=”exit long.png”]

    #80504 quote
    robertogozzi
    Moderator
    Master

    Devi usare un contatore che sia azzerato quando non sei a mercato, mentre quando lo sei inizi a contare partendo da 1 e ricominci da capo se manca la consecutività. Prova questo (non l’ho testato):

    IF Not OnMarket THEN
       Contatore = 0
    ELSIF LongOnMarket THEN         //LONG
       IF close < open THEN               //candela al RIBASSO
          Contatore = Contatore + 1
          IF Contatore = 3 THEN
             SELL AT MARKET
          ENDIF
       ELSE
          Contatore = 0
       ENDIF
    ELSIF ShortOnMarket THEN        //SHORT
     IF close > open THEN               //candela al RIALZO
          Contatore = Contatore + 1
          IF Contatore = 3 THEN
             EXITSHORT AT MARKET
          ENDIF
       ELSE
          Contatore = 0
       ENDIF
    ENDIF
    Nicolas thanked this post
    #80707 quote
    traderwin
    Participant
    Average

    Grazie tante Roberto. provo subito ad inserire il codice all’interno della strategia e testarla

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

Gestione strategia


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
traderwin @traderwin Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by traderwin
7 years, 4 months ago.

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