IL FILTRO ORARIO

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #214925 quote
    Hary Trading
    Participant
    New

    Buongiorno,

    grazie in anticipo a chi vorrà aiutarmi

    ho difficoltà a scrivere un codice che preveda una sorta di filtro orario.

    Mi spiego meglio con un esempio:

    Entra alle ore 16:00 ed esci alle ore 18:00 solo se fino a quel momento la giornata (intesa come, per esempio se parlassimo di NQ, dalle 00:00 alle 15:59) è stata positiva

    Grazie ancora per la disponibilità

    Hary

    #214939 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    IF (OpenTime = 000000) OR ((OpenTime > 000000) AND (OpenTime[1] > OpenTime)) THEN
       Inizio = open
       Fine   = 0
    ENDIF
    IF (OpenTime = 155900) OR ((OpenTime > 155900) AND (OpenTime[1] < 155900)) THEN
       Fine   = close
    ENDIF
    IF Time >= 160000 AND (Fine <> 0) THEN
       IF Fine > Inizio THEN
          BUY 1 CONTRACT AT MARKET
          Fine = 0
       ENDIF
    ENDIF
    IF (Time >= 180000) AND LongOnMarket THEN
       SELL AT MARKET
    ENDIF
    Steven11 thanked this post
    #214955 quote
    Hary Trading
    Participant
    New

    Grazie per la grande disponibilità Roberto

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

IL FILTRO ORARIO


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Hary Trading @adtrader Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Hary Trading
2 years, 8 months ago.

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