avoiding vacation-time trading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #86194 quote
    aland
    Participant
    Average

    Hi there,

    I noticed that my code will not work well during holidays or short days such as this last Thanksgiving half days.

    Is there a command to let the program know to skip half days or vacation days (days taht IG may be still trading on futures but the market is out)

    Thanks in advance

    #86204 quote
    Vonasi
    Moderator
    Master

    You can skip any date of your choice simply by coding it in to your strategy as a condition. The same with time.

    DateOK = date <> 201800301 and date <> 20180801
    TimeOK = time >= 120000 and time < 220000
    
    if DateOK and TimeOK and (your conditions) then
    buy 1 contract at market
    endif
    
    

    Make sure you actually have the candle time in your chosen time frame – for example there is no 233000 candle in an hourly chart.

    If it is the same date every year that you want to avoid then you can do something like this:

    MMDD = date - (round(date / 10000) * 10000)
    
    DateOK = MMDD <> 0103
    aland thanked this post
    #86261 quote
    aland
    Participant
    Average

    ok thanks,

    I was kind of hoping there was some Database with vacation dates that can be used so i won’t have to hard coded it anew each year.

    Thanks

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

avoiding vacation-time trading


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
aland @aland Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/02/2018
Status: Active
Attachments: No files
Logo Logo
Loading...