strategia multi timeframe

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

    Buonasera non riesco a far funzionare una strategia su più timeframe, vi spiego cosa vorrei fare:

    l’ingresso long deve avvenire qundo sul timeframe a un minuto, la chiusura della candela è superiore al massimo della candela precedente sul timeframe a 2 ore, mentre l’ingresso short avviene quando sempre sul timeframe a 1 minuto la chiusura della candela è superiore al massiomo della candela precedente sul timeframe a 2 ore.

    Grazie a chi riesce ad aiutarmi

    #179553 quote
    robertogozzi
    Moderator
    Master

    Ecco:

    Timeframe(2h,UpdateOnClose)
    hh = high[1]
    ll = low[1]
    Timeframe(1 minute,UpdateOnClose)
    IF close > hh AND Not LongOnMarket  THEN
       BUY 1 CONTRACT AT Market
    ENDIF
    IF close < ll AND Not ShortOnMarket THEN
       SELLSHORT 1 CONTRACT AT Market
    ENDIF
    #179554 quote
    Nicolas
    Keymaster
    Master

    Penso che ci sia un problema nella tua descrizione, descrivi la stessa identica configurazione sia per gli ordini lunghi che per quelli corti. Ad ogni modo, ho codificato la strategia nel modo in cui penso che dovrebbe essere:

    defparam cumulateorders=false
    
    timeframe(2 hours,updateonclose)
    hh = high
    ll = low
    
    timeframe(default)
    if close crosses over hh then 
     buy at market 
    endif 
    
    if close crosses under ll then 
     sellshort at market 
    endif 
    
    graphonprice hh
    graphonprice ll
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

strategia multi timeframe


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 10/11/2021
Status: Active
Attachments: No files
Logo Logo
Loading...