Overbought Indicator to avoid top of market retracements

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #174449 quote
    Kovit
    Participant
    Senior

    Hi guys,

    Please can someone help me with some fresh ideas as I have a couple of different reliable strategies but am unable to fully automate them when the price is bouncing around the top of market, positioning trigger is otherwise right but I will normally exit them early in profit to avoid the inevitable retracement into drawdown.

    DJI and NIK on a 3min tf would be particularly helpful if I could add a bit of code that would avoid that top range. I’ve tried fibonacci levels, ranges and a few other things but no luck without seriously battering the gain.  Last resort would be manually adding the upper resistance price level and working back from that but it would need to be regularly adjusted so was hoping for something a bit more dynamic?

    Thanks in advance.

    Kovit

    #174450 quote
    robertogozzi
    Moderator
    Master

    The first thing to do is how to determine a top and a bottom.

    As you can see from the attached pic, it all depends on the lookback period… around the top of the last 30 bars, 300 bars or 3000 bars?

    Once set the lookback period, you need to define AROUND as well. Is AROUND the bottom in that same lookback period? or is it a percentage from the top (at your will or calculated using fibo retracement levels)? or is it a custom number of pips?

    Your eyes can easily define all above info, but code cannot, so you have to set rules using accurate numbers to help it detect what you want.

    x-8.jpg x-8.jpg
    #174454 quote
    Kovit
    Participant
    Senior

    Hi Roberto,

    Thanks for getting back to me so quickly, for me as I tend to be quite risk averse and prefer to build in more of a buffer it would be the 35100 resistance level or even flat 35000 for simplicity sake.

    Thanks

    Kovit

    #174455 quote
    Kovit
    Participant
    Senior

    Maybe I’m over complicating things as it won’t do me any harm to check the charts every day and have a fixed upper resistance price and adjust it as necessary as the market fluctuates.

    #174458 quote
    robertogozzi
    Moderator
    Master

    I can code this:

    • calculate the highest price within the last N bars
    • determine on which lower HUNDRED (final 00) level it sits
    • subtract 100 pips from that level (but you can change that number, 1=100, 2=200, etc…)

    This is an indicator to add ON the price chart:

    N  = 300                //lookback periods
    hh = highest[N](high)   //highest price since then
    HL = (round((hh / 100) - 0.5) - 1) * 100    //replace 1 with any number, even 0.5
    Return HL as "Hundred Level"

    This example will enter a Long trade when long conditions are met, provided the price is BELOW the HL:

    DEFPARAM CumulateOrders = false
    N  = 300                                 //lookback periods
    hh = highest[N](high)                    //highest price since then
    HL = (round((hh / 100) - 0.5) - 1) * 100 //HL = Hundred Level
    MyLongConditions = Not OnMarket AND close CROSSES OVER average[20]
    IF MyLongConditions AND close < HL THEN
       BUY AT Market
    ENDIF
    SET STOP   pLOSS   30
    SET TARGET pPROFIT 60
    Kovit and Midlanddave thanked this post
    #174468 quote
    Kovit
    Participant
    Senior

    That looks perfect and just what I needed, a million thanks Roberto, I’ll add it in now.

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

Overbought Indicator to avoid top of market retracements


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Kovit @kovit Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Kovit
4 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/31/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...