Single out defparam flatafter for a specific day

Forums ProRealTime English forum ProOrder support Single out defparam flatafter for a specific day

Viewing 5 posts - 1 through 5 (of 5 total)
  • #152912

    Hi there,

    It’s all in the title; how can we single out the very useful command DEFPARAM flatafter = time for a specific day and only for long positions?

    I’ve been trying all sorts of tweaking but to no avail I’m afraid…

    Cheers,

    #152913

    Indeed DEFPARAM flatafter = time does not allow anything other than a TIME.

    To be able to exit on selected days, at a given time you can use OpenDayOfWeek and OpenTime:

    This will close any open trade at 190000 on Wednesday and on Friday.

    #152969

    Above won’t work because I forgot to mention that I work with LIMIT orders..

    I can’t squeeze a SELL AT MARKET command because of it; at least, I haven’t figured this out up untill now..

    #152971

    With pending (Limit or Stop) if already triggered you can use the above snippet, while if not triggered they are automatically CANCELLED the next time your code is executed, so you just need to apply the above (modified) snippet not to enter at market after a given time:

    in this case you place a pending order, on Wed. or Fri., only before 190000 (while you make no check the other days). You will also close ALL open orders at 190000 on those two days.

    1 user thanked author for this post.
    #153070

    Tested and working, many thanks!

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

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