Hedging Strategy

  • This topic has 16 replies, 5 voices, and was last updated 7 years ago by avatarMaz.
Viewing 15 posts - 1 through 15 (of 17 total)
  • #16319

    Hi,

    This is my first post on this forum, in fact I have only registered today on this website. I have been playing around with a strategy manually on Pro Real time so wondering if someone could help code this in Pro Order. It is as below:

    (1) Runs everyday between midnight and 16:00 hrs
    (2) At midnight, place one long pending order 1 pip above yesterday’s high and one short pending order 1 pip below yesterday’s low.
    (3) If long order triggers, cancel the existing pending short order and place a new pending short order twice the size at 40 pips below yesterday’s high.
    (4) If short order triggers, cancel the existing pending long order and place a new long order twice the size at 40 pips above yesterday’s low.
    (5) At 16:00 hrs cancel all the pending orders and close all the active positions.

    Thanks

    #16351

    Sorry, forgot to mention, the Stop Loss and Take Profit is 40 pips for the above strategy.

    #16437

    Have you got some good results so far with this manual trading strategy? What is the instrument traded with it?

    #16472

    Hi Nicholas, I have been manually testing this with GBP pairs especially GBP/AUD.  Unfortunately getting up at midnight to place orders and then manually maintaining them until 4pm would a nightmare. Hence would like to code and back-test this. Please let me know if this is feasible.

    #16480

    So you only want to have one trade per day with this strategy? Do you need stoploss and/or takeprofit for orders?

    #16496

    Hi Nicolas, the idea is to take one trade per day however if it doesn’t hit the target leave the one in the opposite direction active to hopefully make profit. The stop loss and take profit is 40 pips. The strategy can be summarized as below:

    1) Runs everyday between midnight and 16:00 hrs
    (2) At midnight, place one long pending order 1 pip above yesterday’s high and one short pending order 1 pip below yesterday’s low
    (3) If long order triggers, cancel the existing pending short order and place a new pending short order twice the size at 40 pips below yesterday’s high.
    (4) If long order hits the target then cancel the existing pending short order.
    (5) If short order triggers, cancel the existing pending long order and place a new long order twice the size at 40 pips above yesterday’s low.
    (6) If short order hits the target then cancel the existing pending long order.
    (&) At 16:00 hrs cancel all the pending orders and close all the active positions.

    Thanks in advance.

    #31430

    Helo I wanted to ask about your startegy how effective has it been and how many trades do you take in a day

    #33720
    Maz

    …@learner and what would be the target? Why 40 pips, where did that number come from and on what instrument? Would you not want a dynamic SR (stop and reverse) distance to chance with market conditions? I’d guess you’d want dynamic targets also? Was this based on some kind of previous study or was it something you thought up?

    On the surface it sounds a bit rigid to work in the long run but I have a snag there might be something in it if some suitable filters are applied.  I’ll have a little look…

     

     

    #33722
    Maz

    Oh excuse me, I see you mentioned GBP pairs. I have a snag about the FTSE also. Shall we have a look then…

    #33724

    oh thanks Maz, that is a post I did not reply quickly enough, so I forgot it!

    #33807
    Maz

    Hi all,

    So I took the premise above and created a little something. The general idea is that if the break of yesterday’s daily high/low (whichever comes first) fails, then a stop and reverse x points away at double the position size is likely to make up for it.

    I tested this out on FTSE. On its own the idea doesn’t work. But once you put in a trend filter (in this case long term MA), it starts to become promising. Below is just a quick version I threw together – a skeleton if you like, which gets the orders in the right places according to the rules above  – so not finished work by any means.

    There are probably some cleaver filters which could be fitting here (ADX, FDI, volume, oscillators, seasonality, etc etc) – so I invite anyone to take a look, have a play around and contribute; as well as test it out on different instruments / asset classes.

     

     

    I’ll see if I can take another look at this when I get the time.

    All the best,

    Maz

    1 user thanked author for this post.
    #33812
    Maz

    Oh and I forgot to mention be careful if you are not in the GMT time zone – be sure to adjust the times in the code.  Also the variables inside “if optimization = 1” section are commented out because I was using the optimizer. Un-comment if you want it to work. ITF attached.

    #33816
    Maz

    Daily high and low

    And again another thing I forgot to mention:

    Instead of using 24-hour dHigh and dLow for the initial day break levels, I am using the high and low from the cash market’s opening hours. So on FTSE 0800 – 1630 GMT highest high and lowest low. Obviously play around with this on different instruments. Could be interesting to see how metals and FX behave.

    Attached is an indicator for debugging. “distance” is for the stop and reverse line relative to highs and lows.

     

    #34059

    Thanks Maz … pleasure to work with your code!

    I can’t claim to have read / understood :), but I managed to squeeze some more profit and a better curve?

    Below is the main change followed by re-optimise of main variables. Attached are results and .itf file.

    GraHal

     

    #34913
    Maz

    @GraHal good idea, good work. I’ll also look further into it 🙂

Viewing 15 posts - 1 through 15 (of 17 total)

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