Strategia suddivisa per giorni

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

    Buonasera, sto creando una startegia che dovrebbe fare i suoi ingressi differenti per orgni gorno della settimana, cerco di spiegarmi.

    per il lunedi ho una strategia, per il martedi un’altra e cosi via per tutti i giorni della settiama, come posso fare per poter scrivere questo codice , grazie.

    #188566 quote
    GraHal
    Participant
    Master

    If Day = 1 and BuyCond Then // Sun = 0, Mon = 1, Sat = 6
    Buy at Market
    Endif

    robertogozzi thanked this post
    #188575 quote
    robertogozzi
    Moderator
    Master

    Il suggerimento di GraHal va benissimno, devi solo usare DayOfWeek invece di Day. Dovrai ripetere quelle istruzuioni per i giorni e le strategie che desideri:

    If DayOfWeek = 1 and BuyCond1 Then
       BUY at Market
    Endif
    If DayOfWeek = 2 and BuyCond2 Then
       BUY at Market
    Endif
    If DayOfWeek = 3 and BuyCond3 Then
       BUY at Market
    Endif
     .
     .
    GraHal thanked this post
    #188578 quote
    emanuele81
    Participant
    Senior

    Grazie mille ragazzi

    #188623 quote
    emanuele81
    Participant
    Senior

    se dovessi imostare una condizione, la strategia non deve entrare a mercato se tra il prezzo di apertuara e il prezzo corrente c’è uno scostamento maggiore del 1,2%, come dovrei fare?

    #188701 quote
    robertogozzi
    Moderator
    Master

    Devi metterla tra le tue condizioni:

    BuyCond1a = Not OnMarket
    BuyCond1b = ((abs(close / open) - 1) * 100) < 1.2 //differenza < 1.2%
    BuyCond1  = BuyCond1a AND BuyCond1b
    If DayOfWeek = 1 and BuyCond1 Then
       BUY at Market
    Endif
    #188721 quote
    emanuele81
    Participant
    Senior

    Grazie Roberto

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Strategia suddivisa per giorni


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by emanuele81
3 years, 11 months ago.

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