orari per aprire un trade

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #201430 quote
    MaoRai54
    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
    MaoRai54
    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.

    #201446 quote
    robertogozzi
    Moderator
    Master

    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
    MaoRai54
    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
3 years, 4 months ago.

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