Buy a specific day

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #224182 quote
    Aragorna
    Participant
    Junior

    Hi,

    I’m doing a simple strategy, just to verify how a ticket like Soybean ZS behave buying at first hour of day and selling last hour.

    DEFPARAM CumulateOrders=false

    OrarioInizioGiorno=000000
    OrariofineGiorno=200000
    TIMEFRAME(1 hour,default)
    IF (DayOfWeek = KK) and time=OrarioInizioGiorno THEN
    buy 1 shares AT MARKET
    ENDIF
    IF time=OrariofineGiorno THEN
    sell 1 shares AT MARKET
    ENDIF

     

    KK goes from 1 to 5. it works until 2015 and nothing more after. any idea why?

    thank’s in advance for your answer.

     

    Alessio

    #224197 quote
    robertogozzi
    Moderator
    Master

    Will you please attach the ITF file?

    #224211 quote
    JS
    Participant
    Senior

    Hi,

    I think that over time the trading hours have been adjusted, when you use the correct trading hours the system works…

    (Remember that the position is opened on the OPEN of the next bar… an hour later)

    DEFPARAM CumulateOrders=false
    
    TimeFrame(1 Hour, default)
    OrarioInizioGiorno = 020000
    OrariofineGiorno = 190000
    
    IF DayOfWeek=1 and NOT OnMarket and OpenTime=OrarioInizioGiorno THEN
    BUY 1 contract AT MARKET
    ENDIF
    
    IF OnMarket and OpenTime=OrarioFineGiorno THEN
    SELL AT MARKET
    ENDIF
    Scherm­afbeelding-2023-11-23-om-17.15.31.png Scherm­afbeelding-2023-11-23-om-17.15.31.png
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Buy a specific day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Aragorna @aragorna Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by JS
2 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/23/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...