Difficulty Programming Support/Resistance Levels

 

Hello,

Thank you for reading this. I am not asking for someone to program for me (although examples of code would be of great value); rather, I would simply like help conceptualizing this problem in a way that the computer can understand. I wish to write a set of functions that identify the high and low of a sideways moving market, both for longer and shorter periods of sideways movement. These levels should have the quality of being both (a) extremes within the movement, and (b) having been tested multiple (more than 1) times. Individual highs/lows for each level should be no more than 10 pips from any other high/low in the level.


Here are some of the difficulties I am having:

-Confusion on defining the start of the sideways market (ie. how far back should the program look to find these levels?) The definition should be: at the end of the last trend, which is the highest/lowest point within the trend. (The fact that that may not be the end of the trend is not important).


-Once the beginning of the sideways trend has been established, how do I select the correct levels? One major problem is that it should not simply be the highest high (or lowest low), it must be the set of highest highs (lowest lows) that are similiar in price (all within 10 pips of each other).


Those are just a couple of the things that are stumping me. If anything is confusing (I'm confused as hell already...) ask me and hopefully we will figure it out.


Whether or not this program will generate a profit is not the main goal here. I feel that in learning how to code the above, I will be able to implement variations of such an identifier in other programs, leading to higher overall quality of programs that I am capable of writing.


Thankyou!!

 

Why don't you try to use Pivot Points?

'Pivot Points Helping to Define Market Trends'

Reason: