Stipulate Day of Week in DEFPARAM

Forums ProRealTime English forum ProOrder support Stipulate Day of Week in DEFPARAM

Viewing 4 posts - 1 through 4 (of 4 total)
  • #5658

    Hello,

    I know I can use the DEFPARAM commands FlatBefore and FlatAfter to tell my system the time to start and stop trading but does anyone know how to incorporate the day of the week as well. Example:

    On Monday

    DEFPARAM FlatBefore = 013000 // Cancel any pending orders, close any positions and prevent placement of additional orders by the trading system before 01:30:00 in the time zone of the strategy.

    On Friday

    DEFPARAM FlatAfter = 230000 // Cancel any pending orders, close any positions and prevent placement of additional orders by the trading system after 23:00:00 in the time zone of the strategy.

    Thanks

    #5662

    Sorry it’s not possible to define specific days of week with FlatBefore or FlatAfter. The best you can do is to create a conditional variable that test the days you want to trade or to close your opened orders, like this :

     

    Is it ok for you?

    #5670

    Hi Nicolas, Thanks for the update.and yes I think that works for me. I’ll test it in my system code

    #7550

    Hey

    If i don´t want it to take positions on Fridays for example. How do i write it? Something like this?

    k= dayofweek (friday)

    if k then
    allowtrade = 0
    else
    allowtrade = 1
    endif

     

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login