Pause Trading in Realtime to 'Cool-off'

Forums ProRealTime English forum ProOrder support Pause Trading in Realtime to 'Cool-off'

Viewing 10 posts - 1 through 10 (of 10 total)
  • #80793

    Hi all,

    I’m looking for a way to ‘pause’ my strategy in the event of a loss. My strategy uses 10min RSI’s and (as is often the case with RSI’s..) on days with very large moves in the market it gets stopped out, however it then re-opens and gets stopped out again and again, most often around 3-6 times during that day. These days can see all the profit wiped out in one go.

    As my strategy only trades around 1 in 4 days, what i would like to do is add code that says if the profit of Position(N-1)<0, then do not open a new trade until at least the following day (or more), i.e. to give the market time to ‘cool-off’ from whatever news caused the event. Clearly nothing can prevent the first loss, but its the compounded loss that i want to negate.

    Any help would be appreciated!

    #80794

    Have you looked at / tried positionperf ??

    Then use Time as a condition for next Trade, e.g. Time > 080000.

    And / or use Nicolas or Vonasi snippet code for Simulated Trades until back in profit (search on this Site for Simulated Trades).

    #80795

    Hi GraHal,

    I was actually in the middle of editing my question to include the PositionPerf function so i didn’t waste people’s time like i have yours! Too late to edit now as well..!

    Aside from that, i’ve literally just stumbled across the TradeIndex function and i think the solution could be to do with combining the PositionPerf with the TradeIndex.

    For example; If PositionPerf(1)<0 and BarIndex<TradeIndex(1)+’Period of time’ Then ‘Do Nothing’ Else ‘Do code’..

    Anyone know if i’m on the right track?

    1 user thanked author for this post.
    #80796

    ah you’ve edited.. both of those sound promising i’ll take a look now, thanks

    #80797

    TradeIndex(1)+’Period of time

    The Period of time would have to be in terms of bars so for 10 min TF … TradeIndex(1)+30 would give you 5 hours forward in time ( 5 x 6 of 10 min bars per hour).

    Yeah sorry I do have an annoying habit of thinking of more info after I post so I often edit posts! 🙂

     

    1 user thanked author for this post.
    #80799

    Ok so the code i’ve added is this;

    In my head the syntax of this works yet the problem is it doesn’t actually seem to do a lot! The performance does change (positively) but quite why i’m not sure. It certainly hasn’t fixed the issue i am trying to fix as i am still seeing numerous losing trades on the same day! Back to the drawing board i guess

    #80806

    Ok so i am indeed a fool.. It appears the above code is actually working! It turns out my error is from looking at the ‘Closed Position List’ vs the ‘Orders List’. I thought my strategy was opening lots of new positions on the same day but instead it is actually using multiple closing points in an unexpected way and therefore gives the impression of more trades in the ‘Closed Position List’.

    I’ll leave this thread open in case anyone would like to draw from it or add other methods..

    Many thanks

    #80840

    instead it is actually using multiple closing points in an unexpected way

    Are you saying that there are Pending Orders that are being cancelled at the end of a bar and a new Pending Order is raised??

    If not above then maybe you can provide a screen shot so we can maybe determine what are the multiple closing points in an unexpected way ??

    #80917

    Hi Grahal, thanks for trying to help solve the latter issue but unfortunately this really was just a case of user error.

    To give an example say my strategy opened a position of 20 lots on day X, on day Y it would then close half (10 lots), then another half (5 lots), then 3 then 2, all on the same day. Under the ‘closed position list’ this appears as if it is 4 separate trades on the same day (day Y), however using the ‘orders list’ tab this behavior is demonstrated, fully explained and 100% correct for how i coded it. This was unexpected as it was supposed to be half (10 lots) then the other half (10 lots), but i re-coded it and found it actually gives better results this way so i’m going to leave it!

    I’ve just come back from a 6month hiatus from the software as i’ve been leaving some strategies to run on untested data before going live with them, embarrassingly i guess i’d just forgotten how to use it properly!

     

    #80926

    embarrassingly i guess i’d just forgotten how to use it properly!

    That’s okay, when I come across some of my older posts I feel like I’ve forgotten loads re coding! 🙂

    Use it or Lose it eh? 🙂

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

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