Thank you
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Colored Support and Resistance Zones
Collapse
X
-
Colored Support and Resistance Zones
I use the Constant Lines indicator to plot Support and Resistance lines. However a line is much too precise. An area of support (or resistance) may be from 0.5 to 2 points wide (in ES). Two contiguous line may not be easily visible in a busy chart. Thus, I wish to combine two immediate Constant Lines in a single S/R zone by giving them the same color and coloring (with transparency) the area in between the constant lines. There are examples of this in some indicators in the File Sharing Section (TRO Buy Zone, VWAP) but I am having problems in putting the indicator together. I am not a programmer and the painted and transparency/opacity section are in the properties section of the code and I do not know how too handle that. I can do minor modifications in the main code and I expect learn more in due time. Could someone provide guidance and help
Thank youTags: None
-
The coloring methods used in those indicators are more advanced techniques. Basically what you want to do is create two DataSeries. One for each of your lines. If you reference the indicators you mentioned already you will notice there is the following loop:Code:for (int seriesCount = 0; seriesCount < 2; seriesCount++)
In essence, the color filling technique used follows the two lines and creates what is known as paths for each. It then fills in the space inbetween the two paths. The only modifying you need to do is to tell it which lines to create paths from.Last edited by NinjaTrader_JoshP; 08-23-2007, 05:28 PM.Josh P.NinjaTrader Customer Service
-
draw region requires so much memory that vista crashes
hello,
i have been using this method:
to make a modification to the Dynamic Support and Resitance Indicator (see attachment) but when i load it on several charts and scroll back historical data my pc running vista locks the application and i am getting a low memory warning message.
The pc has 4 GB ram, i am just using 4 instruments with 14 days historical data, i think this should not be an issue, please correct the attached indicator if possible, but i think ninjatrader has a bug that simply does not allow extensive drawing methods like the draw region ...
regards
peterAttached Files
Comment
-
There is a bug in your indicator code. Basically you are calling the indicator itself in your OnBarUpdate method of that indicator:
DrawRegion("Bollinger Upper Region", CurrentBar, 0, SupportAndResistance(55).Resistance, SupportAndResistance(55).Support, Color.Black, Color.Blue, 1);
-> infinite recursion
Comment
-
Originally posted by NinjaTrader_Dierk View PostThere is a bug in your indicator code. Basically you are calling the indicator itself in your OnBarUpdate method of that indicator:
DrawRegion("Bollinger Upper Region", CurrentBar, 0, SupportAndResistance(55).Resistance, SupportAndResistance(55).Support, Color.Black, Color.Blue, 1);
-> infinite recursion
Can you send me the code snippet what i should be using instead to get a region drawn inbetween the DynamicSR indicators Resistance and Support line?
Thank you very much
Comment
-
Not sure I follow. Where in the sample code of SampleDrawRegion would see a recursive call of SampleDrawRegion (which is what you did on your code)?
Unfortunately we don't have any other sample at hard at this time. As last resort you could contact a certified NinjaScript consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm
Comment
-
Originally posted by NinjaTrader_Dierk View PostThere is a bug in your indicator code. Basically you are calling the indicator itself in your OnBarUpdate method of that indicator:
DrawRegion("Bollinger Upper Region", CurrentBar, 0, SupportAndResistance(55).Resistance, SupportAndResistance(55).Support, Color.Black, Color.Blue, 1);
-> infinite recursion
DrawRegion("tag1", CurrentBar, 0, Bollinger(2, 14).Upper, Bollinger(2, 14).Lower, Color.Empty, Color.Lime, 2);
So i simply exchanged Bollinger.Upper with my indicator and its resistance
data series... (using attached indicator as a base from where to start my own indicator)
Maybe i misunderstand something, so maybe i should reference to the original DynamicSR indicator rather than putting every logic and draw function into a new indicator?Attached Files
Comment
-
hi
I am trying to use the DrawRegion like this:
DrawRegion("fill", CurrentBar, 0, 1253, 1253, Color.Empty, Color.Lime, 2);
I just want to fill between two price values across the chart but I keep getting compile errors.
What section of the code do I put the DrawRegion?
Can I use just numbers?
Comment
-
Hi Dierk,
so I am using the constant line indicator and I want to color between two lines so I use this line in the section
protectedoverridevoid OnBarUpdate()
DrawRegion("fill", 0, CurrentBar, Line1Value, Line2Value, Color.Black, Color.Khaki, 2);
Line1Value and Line2Value are both DataSeries right, created by the Add?
But it still won't compile.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by junkone, Today, 11:37 AM
|
2 responses
14 views
0 likes
|
Last Post
by junkone
Today, 12:09 PM
|
||
Started by frankthearm, Yesterday, 09:08 AM
|
12 responses
44 views
0 likes
|
Last Post Today, 12:05 PM | ||
Started by quantismo, 04-17-2024, 05:13 PM
|
5 responses
35 views
0 likes
|
Last Post Today, 11:32 AM | ||
Started by proptrade13, Today, 11:06 AM
|
1 response
7 views
0 likes
|
Last Post Today, 11:27 AM | ||
Started by love2code2trade, 04-17-2024, 01:45 PM
|
4 responses
35 views
0 likes
|
Last Post Yesterday, 10:31 PM |
Comment