strategia con contatore di barre

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #187831 quote
    emanuele81
    Participant
    Senior

    Vorrei creare una strategia con un contatore di bare,

    Praticamente dopo 2 barre positive consecutive, se la terza barra è schort e chiude sotto al minimo delle due long si enta short, per il long funziona al contrario

    #187877 quote
    robertogozzi
    Moderator
    Master

    Eccola:

    DEFPARAM CumulateOrders = False
    ONCE HH = high
    ONCE LL = low
    Rialzista  = close > open
    Ribassista = close < open
    IF Rialzista THEN
       LL = low
    ELSIF Ribassista THEN
       HH = high
    ENDIF
    IF Rialzista AND Not LongOnMarket THEN
       IF Ribassista[1] AND Ribassista[2] THEN
          IF close > max(HH[1],HH[2]) THEN
             BUY 1 contract at Market
          ENDIF
       ENDIF
    ELSIF Ribassista AND Not ShortOnMarket THEN
       IF Rialzista[1] AND Rialzista[2] THEN
          IF close < min(LL[1],LL[2]) THEN
             SELLSHORT 1 contract at Market
          ENDIF
       ENDIF
    ENDIF
    //graphonprice max(HH[1],HH[2]) coloured(0,0,255,255) AS "Massimo"
    //graphonprice min(LL[1],LL[2]) coloured(255,0,0,255) AS "Minimo"
    Il-Mio-Sistema-1.itf
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

strategia con contatore di barre


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
4 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 02/07/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...