Trend continuation strategy

Forums ProRealTime English forum ProOrder support Trend continuation strategy

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

    Hi all,

    A little help/advice required please. I have a breakout FX strategy that involves buying/selling under certain trending conditions (using MAs and close above/below)

    What I would like to do is only buy/sell above the most recent swing low/high to the left of the chart. Ie the previous high or low visible on the chart. It’s easy to see with the eye manually, but less so to code.

    I have been using the code below:

    ..but wondered if our community had spotted a better definition of ‘trend’ that would be more applicable? Maybe Donchain channel?

    The issue with the above code is that, in this case, highest[1] and highest[7] seems to produce the best results for pair in question on backtest, but I want it to be more dynamic, that is spotting the previous H1 swing high or low, not a calculation of the past [n] bars?

    Any help appreciated!

     

    #76725

    Line 4 can be written

    since the highest price within the most recent bar (just 1 bar)  is the current one refernced by [0] or by null.

    Line 5 should reference, if I understood what you want to achieve, HIGH[1], rather than HIGH, since you already found a high in line 4 and you want to find another higher previously form, so it should be:

    otherwise you would have a chance that both HIGHs are the same, if they happen in the last of 7 bars.

    A BULLish trend is defined as HIGHER highs and HIGHER lows.

    A BEARish trend is defines as LOWER   highs and LOWER   lows.

    You may search this forum to find examples.

     

    #76844

    Thanks for that Robert, yes I was trying to check the trend using the definition of high highs/lower lows for a given chart using the candle at activation time – ie if I want the strategy to start at 0800 and go long then only if price goes higher than the highest high over the last [n] bars.

     

    #76943

    Is that what you mean?

    #76994

    Thanks Robert – I think so yes. I just want to ensure that at pixel time the trade only opens subject to method other rules and final check is that order long/short is only placed above/below the most recent swing high. Is there a more dynamic way of getting PRT to recognise the major swings or do we have to rely on highest [n] bars?
    Thanks

    #77066

    There’s no workaround. Automated strategies cannot do anything different from manual ones, just faster.

    When you sit in front of your PC watching charts you happen very often to spot higher highs (or lower lows), but they are not always swing points. You can tell good swing points from bad ones, when they you see some empty space to their left. In an automated strategy you can estimate empty space with the number of bars to look back. The more they are the more accurate is the swing point.

    The attached pic shows some swing points, one of which is maked with a red cross since it is NOT a swing point, the empty space on the left side is too small!

    So, to go back to your question:

    • n
    • highest[n]/lowest[n]

    are the best way to identify a swing point.

     

    #77074

    Super  -thanks for the reply Robert. As I thought! It seems with backtesting that some FX pairs that [n] can be 6 hours and others 24. Would you hypothesise this as being individual characteristics of each pair (zone, liquidity, interest rates etc) or data mining?

    #77083

    The number of LookBack bars, as the periods for MA’s and so on… for DAX is different from those for EUR/USD or SP500.

    Also, those same numbers for EUR/USD h1 are different from those for EUR/USD daily,….

    It’s a matter of spending (hopefully not wasting) many hours testing different settings!

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