Masters of Array, S/R on variable period

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #188864 quote
    Khaled
    Participant
    Veteran

    Hello everyone,

    When trading manually, we can easily visually identify the breakout/breakdown of a consolidation. This consolidation may last n bars, never the same period.

    However, for Automated Trading, I was not able to code properly the upper and lower limits of a range, where by definition the period “n” is a variable. Intuitively, I’m suspecting Arrays would be helpful but I failed to write a code which works.

    The idea is to identify the upper and low limits of the range (in the boxes in the screenshot). If anyone can please help writing this code or if you can direct me to a link where this code is available on this forum.

    Many thanks

    Capture-décran-2022-02-26-à-08.30.48.jpg Capture-décran-2022-02-26-à-08.30.48.jpg
    #188871 quote
    robertogozzi
    Moderator
    Master

    You can simply use a number of bars:

    hh = highest[20](high)
    ll = lowest[20](low)
    consolidation = (hh - ll) <= 20 * PipSize

    You can use the variable consolidation to detect a range.

    Khaled thanked this post
    #188921 quote
    phoentzs
    Participant
    Master

    Since I don’t understand it right now… what could I do with this value? Go to the market or stay away?

    #188924 quote
    robertogozzi
    Moderator
    Master

    consolidation will be true when a range is detected.

    You decide what to, if you want to trade a range, then enter at market, while you won’t enter if you are looking for a trend.

    Khaled thanked this post
    #188925 quote
    Khaled
    Participant
    Veteran

    I only trade H1 breakout. So, I’m trying to avoid that my system get caught in a range and either have to have a large SL below the low of the range or have a high probability that a fairly narrow SL get hit frequently.

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

Masters of Array, S/R on variable period


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Khaled @khaled Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Khaled
3 years, 12 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/26/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...