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


Support and resistance indicator
Updated: Views / Replies:14,861 / 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

  #41 (permalink)
Elite Member
Quebec
 
Futures Experience: Intermediate
Platform: NinjaTrader wt Rancho Dinero's profiling tools
Broker/Data: Stage 5 trading/AMP/CQG
Favorite Futures: ES, NQ, YM
 
trendisyourfriend's Avatar
 
Posts: 3,697 since Oct 2009
Thanks: 3,041 given, 4,496 received

Adamus,

I draw the zones or lines manually but it is done quickly using a top down approach. I may start on the 120 min. time frame like in the example and use the Fibonacci tool to display one line (50%) which i extend to the right side. I duplicate this Fibonacci line wherever i see a significant level created by the many donchain channels. I can display these Fib. lines on all my charts for a particular symbol if i select Attach to 'All Charts'.

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

Reply With Quote
The following 2 users say Thank You to trendisyourfriend for this post:
 
  #42 (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

Removing S/R lines

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


This indicator has become a monkey on my back. Anyway, trying to complete it by coding it to remove or kill off S/R lines when broken. The problem is that it is so easy to see what should happen by eye, but defining it and coding it is really difficult.

The only way to do this in my non-design-oriented approach is to take example after example and assume that at some point I will have covered enough different situations to make it work in general.

Here's the first situation. I'm looking at the lines of resistance in this chart and I haven't got it quite right yet.

At this point I am not merging the lines yet - I figured this is the more important part to get right.

For a resistance line to be invalidated, the market must go through it, but not go straight through it. If the market shoots off away from this level towards the next on a bar going either closing at least x points away or putting in a low above the line, it flip-flops the resistance into a support level that will be tested by a retrace.

That situation isn't happening in this chart - here a new resistance level in the form of a higher swing high is created, which becomes clear on the close of the 09:00 bar. The market hasn't moved to a totally new level, it's just redefined resistance at this level.

So in this chart, there are 3 lines of resistance and the lines at 1.3065 and 1.3071 should be killed off, leaving only the 1.3078 line. These two lines are basically forgotten by the market and by my way of thinking don't have any impact any more.

I'm going to make a rule here to let me kill off insignificant levels: if a resistance level is penetrated before the market has created a subsequent support level, then the resistance level is invalidated.

You can discover what your enemy fears most by observing the means he uses to frighten you.

Last edited by Adamus; July 11th, 2013 at 12:39 PM.
Reply With Quote
 
  #43 (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

Next roadblock


I finished two rules for cancelling S/R lines and one for flipping them, and cured several mean NinjaScript-based shenanigans, then started work on the labels which need to convey a lot of info and were just too long.

I am currently putting the labels into tooltips which pop-up on mouse hover events for buttons. I need controls for tooltips, e.g. buttons, which I figured would be the easiest to code.

But I hit a problem. It looks like placing a button on the chart causes NT7 to fire Plot() and of course my Plot() creates the buttons, so that creates Windows carnage with an infinite loop.

I'm now trying to create the buttons only once for each S/R level and then to move them around, but I haven't got the code right yet.

If that fails, I'll have to use the onMouseMove() event for the whole chart and check in that for the mouse hovering over any of the buttons. Might be better not to use real button controls anyway and just DrawRectangle instead - although the advantage of button controls is I can code the button click to remove the S/R level from the chart - a nice-to-have.

If there are any hardcore C# developers reading this, then I'd love to hear their opinions about whether this is going to consume vast numbers of CPU cycles.



I'll post a screenshot with the diddy little buttons on the chart if I get them to appear again.

Haha! Fun. Ninja doesn't include buttons in its screenshots. Here's one from ALT+printscreen:

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.

Last edited by Adamus; July 26th, 2013 at 10:04 AM.
Reply With Quote
The following user says Thank You to Adamus for this post:
 
  #44 (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


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


This indicator has become a monkey on my back. Anyway, trying to complete it by coding it to remove or kill off S/R lines when broken. The problem is that it is so easy to see what should happen by eye, but defining it and coding it is really difficult.

The only way to do this in my non-design-oriented approach is to take example after example and assume that at some point I will have covered enough different situations to make it work in general.

Here's the first situation. I'm looking at the lines of resistance in this chart and I haven't got it quite right yet.

At this point I am not merging the lines yet - I figured this is the more important part to get right.

For a resistance line to be invalidated, the market must go through it, but not go straight through it. If the market shoots off away from this level towards the next on a bar going either closing at least x points away or putting in a low above the line, it flip-flops the resistance into a support level that will be tested by a retrace.

That situation isn't happening in this chart - here a new resistance level in the form of a higher swing high is created, which becomes clear on the close of the 09:00 bar. The market hasn't moved to a totally new level, it's just redefined resistance at this level.

So in this chart, there are 3 lines of resistance and the lines at 1.3065 and 1.3071 should be killed off, leaving only the 1.3078 line. These two lines are basically forgotten by the market and by my way of thinking don't have any impact any more.

I'm going to make a rule here to let me kill off insignificant levels: if a resistance level is penetrated before the market has created a subsequent support level, then the resistance level is invalidated.

Hi @Adamus,

Is this new version already available or still in work?

Thanks.
Abde

Reply With Quote
 
  #45 (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

Hi Abde

I think you only scanned the last post, right? It's not uploaded because I can't get the buttons to show!

I need help from someone with higher powers - it's a Windows thing now. In a nutshell, I am creating the buttons off the screen (with minus-value co-ordinates) and then trying to get them to appear by changing the co-ordinates to the correct value in Plot() - but I've no idea if this will work and I can't even change the co-ordinate values yet.

The way I've coded it, I am placing the label button (10px by 10px) at the start of the S/R line. Catching the correct timestamp for the point of creation in OnBarUpdate() and making a correct test for it in the Plot() are both quite complex operations, since it's MTF and each S/R level to be plotted is kept on a per-bar basis.

In fact I find it insanely time-consuming since there are so many edge-effects where something stops working.

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:
 
  #46 (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


Adamus View Post
Hi Abde

I think you only scanned the last post, right? It's not uploaded because I can't get the buttons to show!

I need help from someone with higher powers - it's a Windows thing now. In a nutshell, I am creating the buttons off the screen (with minus-value co-ordinates) and then trying to get them to appear by changing the co-ordinates to the correct value in Plot() - but I've no idea if this will work and I can't even change the co-ordinate values yet.

The way I've coded it, I am placing the label button (10px by 10px) at the start of the S/R line. Catching the correct timestamp for the point of creation in OnBarUpdate() and making a correct test for it in the Plot() are both quite complex operations, since it's MTF and each S/R level to be plotted is kept on a per-bar basis.

In fact I find it insanely time-consuming since there are so many edge-effects where something stops working.

Hi @Adamus,

I meant the S/R indicator which is applied in the embeded plot of my prior post #44.

I know MTF coding is complicated but maybe you can ask for help in the MTF coding thread here: https://futures.io/ninjatrader/9393-coding-multi-time-frame-multiple-time-frames-indicators-ninjatrader.html I wish you good luck.


Last edited by Abde; July 26th, 2013 at 09:24 AM.
Reply With Quote
The following user says Thank You to Abde for this post:
 
  #47 (permalink)
Trading Apprentice
Thessaloniki
 
Futures Experience: Intermediate
Platform: Amibroker
Broker/Data: Dukascopy
Favorite Futures: EUR/USD
 
Posts: 23 since Jun 2010
Thanks: 2 given, 1 received

Hello Adamus

I read with great interest your thread. May I ask what happened? Have you given up?

I too am trying to program Price Action, using Amibroker though. I try to include the YTC ideas in my programs.

Actually right now I am trying to code Support/Resistance and I am looking for an objective way to invalidate S/R lines when they are broken. Your thoughts and questions are exactly what spins in my mind as I am trying to code this project.

Reply With Quote
 
  #48 (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

Hi,
it's been a while since I posted, but I am still very interested in the idea and I'm still developing the indicator with an aim to linking it in to a NT7 strategy so I can do some testing on it.

I invalidate my S/R lines when they are broken by a push which then creates a new S/R level near-by.

Also by a clean break where the market didn't halt at all as a big trend cut through the S/R - i.e. no more than two bars touching the line.

I have to look at my code again! There might be more rules.

What are you using?

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:
 
  #49 (permalink)
Trading Apprentice
Thessaloniki
 
Futures Experience: Intermediate
Platform: Amibroker
Broker/Data: Dukascopy
Favorite Futures: EUR/USD
 
Posts: 23 since Jun 2010
Thanks: 2 given, 1 received

Hello

I am using Amibroker.


Adamus View Post
I invalidate my S/R lines when they are broken by a push which then creates a new S/R level near-by.

I agree with this. Anyway, there is no point having too many lines that are close together. So I try consolidate lines (areas) that are closer than 10 pips on a 5min trading timeframe.


Adamus View Post
Also by a clean break where the market didn't halt at all as a big trend cut through the S/R - i.e. no more than two bars touching the line.

I dissagree with this one. What is your criteria for reversing a support into a resistence line? See Lance's example, vol2 page 62, fig 3.5 where at point A support is broken with a single candle and it turns into a resistance. It is also interesting to watch this video. The guy says that a strong S/R is always penetrated by strong candles: How to Draw Support and Resistance Properly - YouTube .

Here are some of my design notes on the subject:
// Start from Higher timeframe.
// record the reaction after the swings. more points to bigger reactions.
// Also, a second visit to a S/R should attract prices (vacuum effect), gets more points.
// Keep the 2 outer lines.
// Combine the lines that are close together (and give them more points)
// Prefer to keep lines that are further appart from the rest.
// prefer the lower SLs and the upper SHs.
// HighTimeFrame should not have lines closer than 20 pips.
// Keep 3 or 4 lines, by eliminating the lines with less points.
// Round number price levels (e.g. 1.2850, 1.2900 AND 1.3000 for EUR/USD) also tend to act as support AND resistance.
// The more zeroes a price level ends in, the stronger it can support OR resist the prices.

I asked Lance but the invalidation but he has not replied yet on this question.

Reply With Quote
 
  #50 (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


Argh, you totally got me there. That is exactly what I say would invalidate my levels, but in this case I would not invalidate it, i.e. you've pointed out some more work I have to do. What I mean here is that actually that bar that breaks out thro the level is still a part of the setup, and the bars that I feel invalidate a level, well, they come back to the level after being elsewhere and go right through it. They don't set up a setup, they don't respect the level at all, they just come quickly from some other price and go straight thro. Does that make sense?

Re your comments. Interesting. Thinking of using a points system myself. A bit like that Trading Academy supply / demand system. I always got an answer from Lance, I think he's fantastic. I'll have to check my emails, since I asked him once about that too.

You can discover what your enemy fears most by observing the means he uses to frighten you.
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 04:38 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-12 in 0.16 seconds with 20 queries on phoenix via your IP 54.82.112.193