Asian session high/low trading strategy, improvement ideas welcome!

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #93880 quote
    mr blue
    Participant
    Senior

    Dear all

    I came up with the idea to create a short trading strategies that will use the asian high/low of the day as trigger for the rest of the forex trading day.

    At the first glance the code looks good, but I don’t like the sharp decline you see in the  end of the chart.

    Any ideas how to improve the code is very welcome.

    Thanks

    x-fx.itf Unbenannt.jpg Unbenannt.jpg
    #93887 quote
    Vonasi
    Moderator
    Master

    Could you post the actual text of the code (using the ‘Insert PRT Code’ button) to save people from having to import the ITF file? You might get more help if it is easier for people to see the code.

    #93889 quote
    mr blue
    Participant
    Senior
    defparam cumulateorders = false
    
    once vHoch = 000000
    once vTief = 999999
    
    kStart = 000000
    kEnde = 070000
    
    if time > kStart and time < kEnde then
    
    if high > vHoch then
    vHoch = high
    endif
    if low < vTief then
    vTief = low
    endif
    
    endif
    
    if time > kEnde and time < 220000 then
    
    if close crosses over vHoch then
    buy 1 contracts at market
    endif
    
    if close crosses under vTief then
    sellshort 1 contracts at market
    endif
    
    endif
    
    if time = 220000 then
    
    vHoch = 000000
    vTief = 999999
    
    endif
    
    #93890 quote
    mr blue
    Participant
    Senior

    I am aware that the same functionality could be written smarter – but regarding readabiliy I kept this version.

    #93891 quote
    Nicolas
    Keymaster
    Master

    Don’t worry about your coding style 😉 and thanks for sharing the idea.

    So the strategy is allowed to loose multiple times the same day? I think that there might be something to do with orders quantity in a single day?

    #93892 quote
    mr blue
    Participant
    Senior

    I did some analysis on the charts and also regarding fake moves. so it’s better – much better to add the final trigger mark 3 pips above high , lower low.

    the revisted code looks now like this:

     

    defparam cumulateorders = false
    
    once vHoch = 000000
    once vTief = 999999
    
    kStart = 000000
    kEnde = 080000
    
    if time > kStart and time < kEnde then
    
    if high > vHoch then
    vHoch = high
    endif
    if low < vTief then
    vTief = low
    endif
    
    endif
    
    if time > kEnde and time < 220000 then
    
    if close crosses over vHoch+0.003 then
    buy 1 contracts at market
    endif
    
    if close crosses under vTief-0.003 then
    sellshort 1 contracts at market
    endif
    set target pprofit 20
    endif
    
    if time = 220000 then
    
    vHoch = 000000
    vTief = 999999
    
    endif
    
    111.jpg 111.jpg
    #93894 quote
    mr blue
    Participant
    Senior

    Nicolas good point. To be honest I haven’t thought about it. But as you see in v2 I added a TP of 20pips now.

    Yes, maybe additional profit could be generated by placing a “smart” stop loss fx here as well.

    Any suggestions folks?

    #93900 quote
    Vonasi
    Moderator
    Master

    Basically what you have coded is a break out strategy that only trades during the European and US sessions on breakouts of the Asian session high and low. This will always work better in trending markets than in sideways markets so adding a market sentiment filter of some sort might help. Also separating the strategy into two strategies – a long only and a short only might also be beneficial as when the Asian session ends with very close high and low then it is very likely that you will open a trade and quickly get stopped out in a reversal – and possibly many times! Having separate strategies allows you to play a little with different stop ideas other than relying on a breakout in the opposite direction for a stop which could be very close or very far away depending on Asian session volatility.

    mr blue thanked this post
    #93901 quote
    Nicolas
    Keymaster
    Master

    You could also make some data mining (stats) about how orders are performing depending of the High/Low range. Partial closure at predetermined level (e.g. 20 pips profit, next major round level, pivot points, ..) and let the rest run in profit could argue in favor of improvements?

    mr blue thanked this post
    #93910 quote
    Vonasi
    Moderator
    Master

    You could also make some data mining (stats) about how orders are performing depending of the High/Low range. Partial closure at predetermined level (e.g. 20 pips profit, next major round level, pivot points, ..) and let the rest run in profit could argue in favor of improvements?

    Are you suggesting simulating trades to match TP and SL to current market volatility? Sounds right up my street although so far I have found that it as badly lagging as a very lagging indicator from my tests so far.

    Your second suggestion of partial closure would be interesting to test but PRT currently don’t allow us to run this live so it might be wasted effort if you want to run the idea automatically.

    #93920 quote
    mr blue
    Participant
    Senior

    Basically what you have coded is a break out strategy that only trades during the European and US sessions on breakouts of the Asian session high and low.
    > YES

    This will always work better in trending markets than in sideways markets so adding a market sentiment filter of some sort might help.
    -> Could you give me a hint which sentiment filter you think?

    Also separating the strategy into two strategies – a long only and a short only might also be beneficial as when the Asian session ends with very close high and low then it is very likely that you will open a trade and quickly get stopped out in a reversal – and possibly many times! Having separate strategies allows you to play a little with different stop ideas other than relying on a breakout in the opposite direction for a stop which could be very close or very far away depending on Asian session volatility.
    -> Totally agree. But how to accomplish this in PRT? I cannot open long euro and at the same time short euro. Yes, I could go 10x euro mini long and hedge by 1x euro short or play with options – as I do manually. In general – automatic hedging is very tricky or almost impossible with PRT I guess – as we are not able to monitor/trade more than 1 financial instrument withing one algo code.

    #93940 quote
    Vonasi
    Moderator
    Master

    I’m afraid I can’t tell you which sentiment filter but it could be something as simple as a longer term moving average or anyone of the multitude of filters in the library. Maybe jebus89’s idea being discussed here might be a starting point for testing:

    Higher timeframes bollinger filter

    As far as I am aware it is possible to be both long in one strategy and short in another on an instrument. However I believe that if your account is a limited risk account then you can’t do this.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.

Asian session high/low trading strategy, improvement ideas welcome!


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
mr blue @marco_sala Participant
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by Vonasi
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/17/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...