Open position function day of week

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

    Hello,

     

    I’m looking for a code who can autorize open position function of the day of the week. I’m quite sure it already exist but i don’t where finding it.

    The target of course is having different condition to open position function the day of the week, in short or long.

     

    Thanks

    #172519 quote
    robertogozzi
    Moderator
    Master

    This is a hint, just add tdCond to your conditions after selecting the days (and hours evantually) you want to trade:

    ONCE startT = 000000   //Starting TIME
    ONCE endT   = 240000   //Ending TIME
    td0         = 0 AND OpenDayOfWeek = 0 AND OpenTime >= startT AND OpenTime <= endT  //Sunday
    td1         = 1 AND OpenDayOfWeek = 1 AND OpenTime >= startT AND OpenTime <= endT  //Monday
    td2         = 1 AND OpenDayOfWeek = 2 AND OpenTime >= startT AND OpenTime <= endT  //Tuesday
    td3         = 1 AND OpenDayOfWeek = 3 AND OpenTime >= startT AND OpenTime <= endT  //Wednesday
    td4         = 1 AND OpenDayOfWeek = 4 AND OpenTime >= startT AND OpenTime <= endT  //Thursday
    td5         = 1 AND OpenDayOfWeek = 5 AND OpenTime >= startT AND OpenTime <= endT  //Friday
    td6         = 0 AND OpenDayOfWeek = 6 AND OpenTime >= startT AND OpenTime <= endT  //Saturday
    tdCond      = td0 OR td1 OR td2 OR td3 OR td4 OR td5 OR td6
    #172520 quote
    LaurentBZH35
    Participant
    Average

    Thanks Robbertogozzi

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

Open position function day of week


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/26/2021
Status: Active
Attachments: No files
Logo Logo
Loading...