Strategia multitimeframe con ATR

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #185349 quote
    elfuego77
    Participant
    Junior

    Ciao a tutti, volevo creare un sistema semplice che lavorasse sugli eccessi. In Particolare partendo dalla chiusura daily le aree di intervento sarebbero la chiusura +/- valore dell’ATR a 5 periodi. Una volta verificata questa condizione l’entry è data dal crosses under/over del supertrend a 3 minuti. Io ho prodotto il seguente codice che però sembra ignorare le indicazioni che gli do rispetto al daily. Dove sbaglio? Grazie in anticipo per il supporto.

    defparam FLATBEFORE = 080000
    defparam FLATAFTER = 215900
    defparam CUMULATEORDERS=false

    TIMEFRAME (DAILY, UPDATEONCLOSE)
    Range1=Close[0]+Averagetruerange [5] (close)
    Range2=Close[0]-Averagetruerange [5] (close)
    ENTRY=Range1 or Range2

    TIMEFRAME(3mn, Updateonclose)
    ST=Supertrend [3.5,10]

    If close crosses over ST and ENTRY then
    buy contract at market
    elsif close crossees under ST and ENTRY then
    sellshort contract at market
    endif

    SET TARGET PPROFIT 50

    SET TARGET PLOSS 50

    #185485 quote
    robertogozzi
    Moderator
    Master

    La riga ENTRY=Range1 or Range2 è errata, in quanto assegna un prezzo alle variabili, quindi saranno sempre VERE da un punto di vista logico.
    Prova questa:

    defparam FLATBEFORE = 080000
    defparam FLATAFTER = 215900
    defparam CUMULATEORDERS=false
    
    TIMEFRAME (DAILY, UPDATEONCLOSE)
    Range1=Close[0]+Averagetruerange [5] (close)
    Range2=Close[0]-Averagetruerange [5] (close)
    
    TIMEFRAME(3mn, Updateonclose)
    ST=Supertrend [3.5,10]
    
    ENTRY = (close >= Range2) AND (close <= Range1)
    If close crosses over ST and ENTRY then
    buy 1 contract at market
    elsif close crosses under ST and ENTRY then
    sellshort 1 contract at market
    endif
    SET TARGET PPROFIT 50
    SET STOP   PLOSS   50
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Strategia multitimeframe con ATR


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
elfuego77 @elfuego77 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: 01/13/2022
Status: Active
Attachments: No files
Logo Logo
Loading...