HAIKEN ASHI – STRATEGIA BASE

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #189131 quote
    GIULIO.BI
    Participant
    New

    Buongiorno,

    sono un nuovo utilizzatore del prorealtime e mi sto dedicando ai sistemi automatici.

    Ho visto che la creazione semplificata non riconosce le HA.

    Vorrei creare un semplice sistema su candele haiken ashi dove compro alla prima verde senza lower shadow e vendo alla prima rossa qualunque e viceversa per lo short. Sarebbe utile anche un indicatore che restituisce il colore delle HA.

    Qualcuno può aiutarmi? Grazie in anticipo.

    P.S.: Ho notato anche nella demo, in qualunque sistema, c’è un ritardo di una candela, c’è anche in versione real?

    #189146 quote
    robertogozzi
    Moderator
    Master

    Ecco:

    // HA - definizione candele Heikin-Ashi
    //
    xOpen = open
    xClose     = (open + close + high + low) / 4
    if barindex > 0 then
        xOpen  = (xOpen[1] + xClose[1]) / 2
    endif
    xLow       = min(low,min(xClose,xOpen))
    xHigh      = max(high,max(xClose,xOpen))
    //xTypic   = (xHigh + xLow + xClose) / 3
    //xMed     = (xHigh + xLow) / 2
    //xRange   = xHigh - xLow
    Verde = xClose > xOpen
    Rossa = xClose < xOpen
    OmbraSup = xHigh - max(xOpen,xClose)
    OmbraInf = min(xOpen,xClose) - xLow
    Lcond = Verde and (OmbraInf = 0) and Not OnMarket
    Scond = Rossa and (OmbraSup = 0) and Not OnMarket
    If LCond then
       Buy 1 contract at Market
    Elsif Scond then
       Sellshort 1 contract at Market
    Endif
    If LongOnMarket and Rossa then
       Sell at Market
    Endif
    If ShortOnMarket and Verde then
       Exitshort at Market
    Endif

    Le strategie vengono sempre eseguite alla chiusura di ogni barra, per cui la freccia d’ingresso la vedi sulla barra che si apre, ma non c’è nessun ritardo,

    #189158 quote
    GIULIO.BI
    Participant
    New

    Grazie Roberto!

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

HAIKEN ASHI – STRATEGIA BASE


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
GIULIO.BI @giulio-bi Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by GIULIO.BI
3 years, 11 months ago.

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