orari per aprire un trade

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #201430 quote
    MaoRai54MaoRai54
    Participant
    Master

    buongiorno a tutti.

    Sto testando un sistema semplice ma che attiva il trade solo in certi orari e li chiude a certe condizioni, anche fuori orario.  Ma nel dettaglio delle operazioni vedo che ne apre anche fuori dai miei orari.

    Ho provato sia scrivendo:

    if NOT ONMARKET and RSI[RR](close)=>W55  and hour<=16 and hour=>6 then

    che usando currenthour  al posto di hour ma apre sempre anche fuori orario.

    chi mi aiuta?  Grazie

    #201437 quote
    MaoRai54MaoRai54
    Participant
    Master

    poi navigando sul forum ho trovato Roberto che suggerisce di usare TIME.

    L’ho fatto ma apre sempre quando vuole.   C’é per caso un limite al numero di variabili da inserire in un IF  ?

    qui posto il TS che sto facendo basato su un video visto su Youtube di EasyTrade. Sembra interessante ma nel video non era automatizzato.

    EasyTrade_5m_Eu-R1-rev.itf
    #201446 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Scrivi queste due righe con le parentesi dove c’è OR:

    if NOT ONMARKET and RSI[RR](close)=>55 and MB>MR and StK>StoD and (StK<=80 or StK=>20) and (StoD<=80 or StoD=>20) and TTT then
    if NOT ONMARKET and RSI[RR](close)<=45 and MB<MR and StK<StoD and (StK<=80 or StK=>20) and (StoD<=80 or StoD=>20) and TTT then

    ovviamente verifica che io le abbia messe dove tu desideri, è facile sbagliare la logica. E’ sempre bene usare le parentesi, anche quando sembrano superflue (come hai fatto, opportunamente, per TTT). Io le uso anche in normali espressioni dove c’è una naturale precedenza matematica, tipo 3 + 2 * 4, che io scrivo sempre 3 + (2 * 4), perché, pur essendo superflue, mi danno visivamente un’immediata interpretazione della sequenza.

    Non utilizzare CURRENTIME, è un duplicato di TIME. Usa in alternativa OPENTIME se vuoi prendere in considerazione l’orario di apertura della candela, invece di quello della chiusura.

    MaoRai54 thanked this post
    #201453 quote
    MaoRai54MaoRai54
    Participant
    Master

    @ Roberto

    Grazie.   Ora sembra funzionare e prende gli orari giusti.  Ma quindi era solo colpa delle parentesi non messe per non far considerare gli orari ?

    #201456 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Si, esatto, era solo colpa delle parentesi.

    MaoRai54 thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

orari per aprire un trade


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
MaoRai54 @maorai Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/26/2022
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...