backtest di strategie con grafici HA

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #188326 quote
    eningi
    Participant
    New

    C’è un modo per testare il codice già presente in Proscreener? Se il codice di programmazione fosse necessario per testare le strategie con HA, gentilmente potreste aiutarmi a scrivere il codice di backtest per le ultime due strategie (HA sotto la mm20 e HA dopo un ritracciamento del trend) presenti nel link:

    programmare grafici Heikin Ashi

    #188388 quote
    robertogozzi
    Moderator
    Master

    Eccoli.

    // #1
    //	
    xOpen = open
    xClose = (open + close + high + low) / 4
    if barindex > 0 then
       xOpen = (xOpen[1] + xClose[1]) / 2
    endif
    Verde = xClose > xOpen
    Rossa = xClose < xOpen
    L1 = Rossa                          //Attuale ROSSA
    L2 = Verde[1]                       //La prima   precedente VERDE
    L3 = Verde[2]                       //La seconda precedente VERDE
    L4 = (summation[4](Rossa[3]) = 4)   //dalla 3a alla 6a precedente tutte ROSSE (sono 4 candele)
    Lcond = L1 AND L2 AND L3 AND L4
    IF Lcond AND Not OnMarket THEN
       BUY 1 Contract at Market
       SET STOP   pLOSS   100
       SET TARGET pPROFIT 300
    ENDIF
    // #2
    //	
    xOpen    = open
    xClose   = (open + close + high + low) / 4
    if barindex &gt; 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
    //
    Sma20 = Average[20]                 //Sma calcolata sulle candele giapponesi normali
    //Sma20 = Average[20](xClose)       //Sma calcolata sulle candele HA
    Verde = xClose > xOpen
    Rossa = xClose < xOpen
    L1 = Verde                          //Attuale VERDE
    L2 = Verde[1]                       //La prima   precedente VERDE
    L3 = (summation[5](Rossa[2]) = 5)   //dalla 2a alla 6a precedente tutte ROSSE (sono 5 candele)
    L4 = xHigh[1] < Sma20               //Il massimo HA precedente deve essere sotto la Sma20
    Lcond = L1 AND L2 AND L3 AND L4
    IF Lcond AND Not OnMarket THEN
       BUY 1 Contract at Market
       SET STOP   pLOSS   100
       SET TARGET pPROFIT 300
    ENDIF
    eningi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

backtest di strategie con grafici HA


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
eningi @eningi Participant
Summary

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

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