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,225 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

  #41 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,171
Thanks Received: 6,018

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'.


Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
  #42 (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



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.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #43 (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 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:


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


Adamus View Post


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)
 
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

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.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #46 (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


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: I wish you good luck.

Reply With Quote
Thanked by:
  #47 (permalink)
bgeorge
Thessaloniki
 
Posts: 29 since Jun 2010
Thanks Given: 4
Thanks Received: 8

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)
 
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

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.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #49 (permalink)
bgeorge
Thessaloniki
 
Posts: 29 since Jun 2010
Thanks Given: 4
Thanks Received: 8

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 [AUTOLINK]Support and Resistance[/AUTOLINK] 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)
 
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


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.
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread 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