Support and resistance indicator - NinjaTrader Programming | futures io social day trading
futures io futures trading


Support and resistance indicator
Updated: Views / Replies:14,854 / 63
Created: by Adamus Attachments:15

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 15  
 
Thread Tools Search this Thread
 

Support and resistance indicator

  #1 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

Support and resistance indicator

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.
Reply With Quote
The following 11 users say Thank You to Adamus for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

This is the current list of things to do, updated here whenever I can cross one off - or find another one to add:
  1. automatically merge S/R swing highs & lows that are close together, with a parameter that tells the indie what "close together" actually is in terms of ticks - less extreme swing points merge together with near-by more extreme prior swing points, but not vice-versa - a more extreme swing point invalidates the near-by less extreme swing point
  2. automatically merge swing highs & lows with near-by round number levels and session highs / lows, forming bigger zones
  3. document the rules
  4. instead of just a line for a level, create a zone based on how the swing point was formed, e.g. just the tails of the candles, or the hi and low of the small candle in a morning star candlestick pattern etc., and make this a choice - i.e. a parameter for either just using a line at the high or low point, or a zone stretching between the high or low point, and back to a significant price such as a candle close or near-by high or low
  5. create an S/R level at a break-out point from a consolidation zone


Last edited by Adamus; July 31st, 2013 at 02:12 PM.
 
  #3 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received


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

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

You can discover what your enemy fears most by observing the means he uses to frighten you.
Reply With Quote
The following 7 users say Thank You to Adamus for this post:
 
  #4 (permalink)
Elite Member
Germany
 
Futures Experience: Intermediate
Platform: FlatTrader
Broker/Data: GFT and Interactive Brokers
Favorite Futures: ES, DAX
 
Posts: 531 since Aug 2010
Thanks: 2,121 given, 719 received

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: https://futures.io/ninjatrader/7300-constant-zone-plots-wrong-panel.html

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

Reply With Quote
 
  #5 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received


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: https://futures.io/ninjatrader/7300-constant-zone-plots-wrong-panel.html

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.
Reply With Quote
The following user says Thank You to Adamus for this post:
 
  #6 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

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.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


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.
Reply With Quote
The following user says Thank You to Adamus for this post:
 
  #7 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

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.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


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.

Last edited by Adamus; February 27th, 2013 at 10:55 AM. Reason: incomprehensible bits
Reply With Quote
 
  #8 (permalink)
Elite Member
Michigan, Jackson
 
Futures Experience: Intermediate
Platform: NT and TS
Broker/Data: NT Continuum
Favorite Futures: ES, CL
 
Posts: 858 since Jul 2009
Thanks: 389 given, 547 received


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"

Reply With Quote
The following user says Thank You to COTtrader for this post:
 
  #9 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

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.

Last edited by Adamus; February 27th, 2013 at 03:28 PM.
Reply With Quote
 
  #10 (permalink)
Elite Member
Michigan, Jackson
 
Futures Experience: Intermediate
Platform: NT and TS
Broker/Data: NT Continuum
Favorite Futures: ES, CL
 
Posts: 858 since Jul 2009
Thanks: 389 given, 547 received


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"

Reply With Quote

Reply



futures io > > > > > Support and resistance indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
A different look at Support and Resistance Xav1029 The Elite Circle 18 September 1st, 2012 07:07 AM
Support and Resistance SpyderTrader NinjaTrader Programming 11 May 13th, 2012 05:24 PM
Support and Resistance tony2009 Traders Hideout 13 July 8th, 2011 07:12 PM
Support / Resistance indicator? tberwick Traders Hideout 10 April 19th, 2010 12:49 PM


All times are GMT -4. The time now is 07:41 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-11 in 0.19 seconds with 20 queries on phoenix via your IP 54.226.132.197