NexusFi: Find Your Edge


Home Menu

 





Support and resistance indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Adamus with 33 posts (32 thanks)
    2. looks_two bgeorge with 9 posts (1 thanks)
    3. looks_3 Cloudy with 6 posts (3 thanks)
    4. looks_4 Abde with 5 posts (2 thanks)
      Best Posters
    1. looks_one trendisyourfriend with 1.7 thanks per post
    2. looks_two Adamus with 1 thanks per post
    3. looks_3 COTtrader with 0.7 thanks per post
    4. looks_4 Cloudy with 0.5 thanks per post
    1. trending_up 31,247 views
    2. thumb_up 47 thanks given
    3. group 17 followers
    1. forum 63 posts
    2. attach_file 15 attachments




 
Search this Thread

Support and resistance indicator

  #1 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

I just uploaded my first attempt at a support and resistance indicator here

Currently it's pretty basic and it's mostly unusable! Yes I know that sounds dumb but I put it up here because I figured some other people might be interested in the same thing and have advice or suggestions.

So far, I'm just showing S/R lines based on swing highs and swing lows, defining a swing as a high or a low surrounded by 2 bars either side that are lower or higher respectively.

This generates a lot of lines, but I put the lines onto a much smaller time frame chart and then it starts to make sense, i.e. I have a long timeframe (e.g. 60mins - invisible) and a trading timeframe (e.g. 3mins) and I apply the indie to the 60min data series but show the lines on the 3min series.

On the list of features is to integrate the higher timeframe dataseries into the indie so as not to require it on the chart.

In the short term, this is meant to help my discretionary trading but cutting out the painstaking process in NT7 of drawing the lines individually onto the chart.

In the long term, I want to use it programmatically in strategies so my strategies can avoid doing dumb things like going long right under resistance.

In future versions, I want to automatically merge S/R lines that are close together, with a parameter that tells the indie what "close together" actually is in terms of ticks.

I also want to add levels for round numbers, e.g. 1.3500 and 1.3550

And I also want to add session highs and lows for the current session since they often don't make it into the higher timescale S/R.

It would also be good to parameterize how many bars either side of the swing high / low are needed to make it a swing high / low. It's currently fixed at 2, but 3 or 4 might be better.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
Build trailing stop for micro index(s)
Psychology and Money Management
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
  #3 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789


List of things to do, in rough order of importance:
  1. automatically merge S/R lines that are close together, with a parameter that tells the indie what "close together" actually is in terms of ticks
  2. add levels for round numbers, e.g. 1.3500 and 1.3550
  3. integrate the higher timeframe dataseries into the indie so as not to require it on the chart, which will mean hard-coding it. Might need to add the daily data as well I just realised today - see chart - bottom support is from December, which doesn't make it onto my 3min or 60min chart
  4. add session highs and lows for the current session since they often don't make it into the higher timescale S/R
  5. add the ability to downgrade S/R lines that come from uninteresting hours, e.g. the Asian session during the EUR/USD forex day, by using 3 bars either side for the definition of swing points (might not be so useful, but interesting to try out)
  6. parameterize how many bars either side of the swing high / low are needed to make it a swing high / low. It's currently fixed at 2, but 3 or 4 might be better
  7. create a dataseries property with all the levels in, which a strategy can call


You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 Abde 
Stuttgart / Germany
 
Experience: Intermediate
Platform: FlatTrader
Broker: GFT and Interactive Brokers
Trading: ES, DAX
Frequency: Every few days
Duration: Days
Posts: 533 since Aug 2010
Thanks Given: 2,141
Thanks Received: 729

Hi @Adamus,

Congrats to your new indicator and thanks for sharing!

I like to use it for the big picture support and resistance levels and apply it to display daily and weekly levels. But right now that´s not applicable at a small timeframe chart like a 5 minute.

I think the most important feature is to integrate the higher timeframe dataseries into the indie.

Also good would be a option to display user configurable zones like in the ConstanZonesV2 indi in post 8 from here:

A continuing improvement would also be to have an option for audio alerts with an user selectable tick offset.

Reply With Quote
  #5 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789


Abde View Post
Congrats to your new indicator and thanks for sharing!

I like to use it for the big picture support and resistance levels and apply it to display daily and weekly levels. But right now that´s not applicable at a small timeframe chart like a 5 minute.

I think the most important feature is to integrate the higher timeframe dataseries into the indie.

Yes that is pretty close to the top of the list.


Abde View Post
Also good would be a option to display user configurable zones like in the ConstanZonesV2 indi in post 8 from here:

You think so? Isn't it just as easy from the user's perspective to keep the indicators seperate, and to save them together as a template rather than have the code merged into one indie?


Abde View Post
A continuing improvement would also be to have an option for audio alerts with an user selectable tick offset.


This is the same situation - rather than build one colossal indie that does everything, it's better generally to keep them seperate and save them together into a template if you want it to be easy to apply to a new chart.

That way, if some writes a better alert indie, or zone indie, or even s/r indie, you can easily swap it out on your charts rather than wait for the indie developer of the colossal indicator to incorporate the new stuff.

Could be done though, no doubt about that.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #6 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Today on the EUR/USD the indicator just ran out of data on the settings I'm using.

I had the daily dataseries set to 100 days of history and the 60min set to 30 days.



The market moved into territory not seen for a month and the S/R just disappeared - at least from the 60min chart.

The S/R from the daily chart was too far off - the next support is down at 1.3000.

Had to set the 60min dataseries to load up 60 days and then all was fine - the performance wasn't noticeably slower despite about 200 lines being plotted.

This will be something to check before every session - that I've got enough data to show S/R up to 200 points in either direction.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Been max'ed out with work on my trading plan and psychology programme, so I haven't had a chance to do much on this.

All I can say is, it's probably gonna get worse before it gets better.

At the moment there is way too much stuff on the screen to be able to see what's going on. I obviously programmed this indi to see those levels, but I also want to be able to see past them. Hmm. Never was good at visual design.



Apart from that road-block, I programmed the indi to generate a List of S/R levels rather than an array which means the number of S/R levels it can plot is restricted only by NinjaTrader and how well it can utilise the Win7 and the hardware.

So far so good in terms of performance. There are 350 levels of S/R plotted here and it doesn't need noticeably more time to load the chart.

What I want to do next is load up S/R levels generated on different time-frames. After a working career in software development, there's no way I can hard-code them because this isn't just RAD, this is a serious indicator that I want to re-use without reprogramming.

I figured there might be a way to do this by decoupling the S/R determination from the chart plot, putting them in seperate indicators. I can create an indicator that does nothing except identify swing points and sticks them in a dataseries. Then I create the second indicator which will plot the S/R levels from the chosen time-frames.

I think I'd have to hard-code the time-series into the second indicator - say, the weekly, daily, 4 hourly, 2 hourly, hourly, 1/2 hourly and 15mins time-frames - and hard-code the first indicator onto each.

Then I'd have true/false parameters to let the user decide which ones to plot. I'd just use the daily and the hourly myself at this point.

Sounds like a lot of overhead but I figure I can disable most of the processing, making the 1st indicator return direct out of the onBarUpdate if it's not enabled. That would be 7 time-series and they'd be more than 50% disabled. My guess is that's not much overhead.

There wouldn't be anything for this 1st indicator to plot - it's just discovering swing points, not plotting them - so hopefully I can work out how to prevent NT7 from doing any plot overhead for it. Maybe it doesn't even need to be an indicator, it can just be a function.

The main point is that the enabled indicators have a data-series accessible to the 2nd indicator so the 2nd indicator can grab all the swing levels generated.

Thinking ahead, the 2nd indicator will then have a big unsorted list of S/R levels. It'd be better to have it sorted, so each new S/R level generated can be checked against what's there already, and if it's close to an existing one, instead of plotting 2 lines, I'd plot a shaded zone (which is what I'm doing already but just instead of lines).

I'll try it out. Probably sounds over the top, maybe it is - I guess I'll find out.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #8 (permalink)
 
COTtrader's Avatar
 COTtrader 
JACKSON, MICHIGAN
Legendary Market Wizard
 
Experience: Intermediate
Platform: TS and Trading View
Broker: TS
Trading: ES Awesome!
Posts: 955 since Jul 2009
Thanks Given: 406
Thanks Received: 648


Adamus View Post
What I want to do next is load up S/R levels generated on different time-frames. After a working career in software development, there's no way I can hard-code them because this isn't just RAD, this is a serious indicator that I want to re-use without reprogramming.

Adamus,

Sounds brilliant. Any workable code found in the Price Action Swing Pro indicator? It provides naked and historical Swing Lines. It also provides statistical analysis that could be arranged to show you higher time frames, too.

Ken "COTtrader"

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Yes that's certainly something I should study, there may be some stuff I can take on board - although I have an immediate mental block at the thought of moving away from simple horizontal lines. Will have to sleep on it.

Just had some more thoughts on this.

I can get rid of any support lines that are above the market, and any resistance lines that are below the market.

Some people hold that S/R lines get broken and cease to exist once the market has gone through them. In my humble experience I find that S/R lines don't die so easily. They take a lot of criss-crossing to nullify the emotional impact they had when they were created.

However they do flip-flop: support will become resistance and resistance will become support. That is going to be interesting to code, but it should reduce the number of lines on the screen.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #10 (permalink)
 
COTtrader's Avatar
 COTtrader 
JACKSON, MICHIGAN
Legendary Market Wizard
 
Experience: Intermediate
Platform: TS and Trading View
Broker: TS
Trading: ES Awesome!
Posts: 955 since Jul 2009
Thanks Given: 406
Thanks Received: 648


More simply something like the Swing Indicator using Ray Lines. It removes violated (naked) S/R lines.

IMHO, S/R lines of the last N-days HVNs and LVNs.

Ken "COTtrader"

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on May 3, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts