Grid Trading for ranging markets

Forums ProRealTime English forum ProOrder support Grid Trading for ranging markets

Viewing 8 posts - 1 through 8 (of 8 total)
  • #234971

    Hi all,

    I am wondering if there is a simple grid trading code to buy and sell at predetermined levels on a chart. There was a topic many years back in 2016/17 but this was more of position building and trailing stops etc. What I am looking to do is more simple to start with. An eg:

    Index is at 1,000
    1) Set the grid size, say 10 points and take profit, say 10 points. Set max index level of grid operation say 900 – 1100. Set start index level of strategy ie only operates once it hits that level, say 1000.
    2) Open a buy AND sell position at 1000 with a 10pt take profit
    3) If Index goes to 1010 long will be closed. Enter another long and short @ 1010 with same limit.
    4) OR if index goes to 9990 short will be closed. Enter another long and short at 9990 with same limit
    5) And so on… Every time a grid level (ie 10pts hits) the system automatically opens another Long and/or Short at that level so that you always have one each of long and short positions at every level.
    6) It only opens the relevant position so that there is a long and short remaining at each level. ie in above example if index goes from 1010 back to 1,000 then it only opens another long at 1000 as it already still has the original short open from 2)

    Yes, you will have to take into account spreads and the spreads will mean you are giving away money each time but this is not meant for trending markets.
    And of course if the market goes in one direction only you will have increasing positions and margin to contend with. Hence parameter levels within which the strategy operates are crucial.
    But this is just the first test phase where I’m testing and applying to select ranging or long/short bias markets ie ones where there is a good likelihood of this working. Am working on a filter that provides this.

    The premise being if an index trades within 990 -1100 for 6 mths you have 200pts to work with if you happen to be so good to time it exactly right each time. But with oscillation you can accumulate possibly many more points than this even if you end up at the same index closing level and you don’t have to try and time it as much.

    Happy to share results as we go along so others can benefit. I am manually trading this on certain markets so see some potential. Can prob code this with time but I’m a bit rusty so any help appreciated !

    Please ask if any questions.

    Many thanks.

    #234972

    Enter another long and short @ 1010 with same limit.

    Does above need Long and Short open at same time?
    If Yes, we can’t do that with AutoTrading, manual yes, but not Algos, well not within the same coded Algo.

    You would need 2 separate Algos to enter Long and Short at same time.

    Just a few thoughts.

     

    1 user thanked author for this post.
    #234973

    Hi – Thanks for the input. Yes it has to be long and short at the same time otherwise it doesn’t work.

    I was not aware you couldn’t do this in algos because as you say in manual, its allowed.

    The problem with doing 2 separate algos is that they can’t “talk” to each other but I guess it could still work as all you need to do is code it like this for the long side:
    1) Long at 1000
    2) Limit order to buy at 990
    3) Stop Limit buy at 1010
    4) Those 3 implements the first set of trades/orders.
    5) Thereafter every time the index reaches a multiple of 10 (or as defined), if there is no long position then open one at that level with a limit of 10

    Think something like that could work.

    #234985

    Pending orders can actually be both Long and Short at the same time, but if both orders are triggered, the second one will reverse closing the first trade.

     

     

    1 user thanked author for this post.
    #234989

    Thanks for the confirmation. Ok so it seems that doing it in one algo is not going to work. Thats fine we’ll have to work around that and split into separate long and short.

    If anyone has any input on how to develop the long only grid code as detailed above then it would be appreciated. I can then amend (hopefully!) for the short side and test out and take it from there.

    #234990

    Shuld not be to hard, as long as you use the same “zero point” both algos shuld be on the same clock.

    I gess the best way would be to define a 0 and then the levels above are + and the ones below are -.

    Then use a loops to define the stepps ect and put limit/stop orders depeding on wher on the grid the price is.

    1 user thanked author for this post.
    #234998

    Ok, thanks. I’ll have a go at doing that, will try sourcing some old code from other strategies to use as a base though not sure exactly how to use the loops correctly but will try and figure it out.

    #235007

    Ok, thanks. I’ll have a go at doing that, will try sourcing some old code from other strategies to use as a base though not sure exactly how to use the loops correctly but will try and figure it out.

    I would recomend the training courses, the expert one goes over loops and how to make lines in the charts.

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

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