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
Dynamic Support and Resistance lines using HMA
Collapse
X
-
Missed two statements
changed CurrentBar<3 to period
Added Average Plot
Hope this helps
Pat
-
Attached is what I made and algorithm doesn't seem correct. Hope someone can help.
Thanks
QAttached Files
Leave a comment:
-
Try adding curly braces around the 2 statements after each if condition, like this...
Code:if (condition) { statement1; statement2; }
Leave a comment:
-
Hi Pat,
Would you mind uploading your code as zip or .cs? I'm getting a syntax error.
Code:if (HMA(period)[0]>HMA(period)[1]) int HH = Math.Max(High[0],HH); Resistance.Set(Resistance[1]); if (HMA(period)[0]<HMA(period)[1]) int LL=Math.Min(Low[0],LL); Support.Set(Support[1]); if (HMA(period)[0] <HMA(period)[1] && HMA(period)[1]>HMA(period)[2]) Resistance.Set(HH); LL=Low[0]; if (HMA(period)[0]>HMA(period)[1] && HMA(period)[1]<HMA(period)[2]) Support.Set(LL); HH=High[0];
Q
Leave a comment:
-
High Pobability trades
With this you will get high probability long trades when the low crosses above Resistance and short trades when the High crosses below Support.
Either case you set the stop loss to 5 pips below or above the SnR lines and bring them to breakeven asap.
Exit the long trade when the Resistance plot shootups or some kind of a trailing stoploss is hit. Similarly for the short trade.
The above would be relevant once a trend has been established, using, for example, RAMA.
Use a higher time frame, e.g 5 minutes to establish a setup and a lower time frame , 1 minute to time the trade.
Hope this helps.
Pat
Leave a comment:
-
Try this
Create a variable HH, to keep track of the highest high if the colorof HMA is Positive or the average is rising.
Create another variable, LL, to keep track of the lowest low if the color of HMA is negative or the average is falling.
Create two plots, Resistance and Support.
The values of these plots do not change unles the HMA condition is met.
// if the indicator is rising , keep track of the higest high;
IF HMA[0]>HMA[1] then
HH=Math.Max(High[0],HH);
Resistance.Set(Resistance[1]);
// if the indicator is falling keep track of the lowest low.
IF HMA[0]<HMA[1] then
LL=Math.Min(Low[0], LL);
Support.Set(Support[1]);
// If the indicator turns down, reset LL and change Resistance to the highest high.
IF HMA[0] <HMA[1] and HMA[1]>HMA[2] then
Resistance.Set(HH);
LL=Low[0];
// If the indicator turns up, reset HH to current High, and change Support to LL.
IF HMA[0]>HMA[1] and HMA[1]<HMA[2] then
Support.Set(LL);
HH=High[0];
Hope this helps
Pat1Last edited by APat1; 11-07-2007, 05:29 PM.
Leave a comment:
-
Maybe try
Code:Swing(5).SwingHighBar(0, 1, CurrentBar) Swing(5).SwingLowBar(0, 1, CurrentBar)
Leave a comment:
-
Hi prostyle,
I basically use it as is and take small losses when it is not doing anything. This is a method that is somewhat similar to the Decisionbar strategy. The only conflict I'm currently having is that I'm not able to pick the exact swing highs/lows because my logic is flawed. I'm using highestbar and lowestbar of last x bars and I think there must be another way around this. If anyone care to give me a few tips on how to solve this, it would be great.
thanks
Qi
Leave a comment:
-
The general usage guidelines in this post is how I use TRO's Dynamic S/R. In real-time its much harder to discern how to act on new highs/lows, but that just comes with experience on watching particular instruments. The idea is for a quick scalp not major movements. Also it seems to work better on volatile stocks. Hope that helps.
I'm not sure how qitrader uses his implementation of the dynamic S/R, but I would love to hear about it too.Last edited by NinjaTrader_JoshP; 10-06-2007, 09:51 PM.
Leave a comment:
-
Hello,
Your dynamic s/r levels indicator is great.
If you don't mind sharing - I have a question
for you?
How do you trade with this indicator?
I see the obvious "breakouts" and "breakdowns"
but what other indicators or method do you
attach to this to keep you out of the the trades
that go no where. Or what keeps you out of
as many of those types of trades as possible?
If you can explain that would be much appreciated,
if not I understand.
~C
Leave a comment:
-
You do not need to use an input to displace an indicator. Just call SMA(15)[4]. That will displace it 4 spaces to the right. Make sure you have this in the beginning of OnBarUpdate() though.
Code:if (CurrentBar < 4) return;
Leave a comment:
-
How do I write the following code?
if(Close[0]> X[0] && Close[1] < X[1]) where X is a displaced simple moving average of 5 bars to the right.
I tried SMA (15,4)[0] (displaced 4 bars) but didn't work
Any ideas...going to try a different algorithm
Leave a comment:
-
Originally posted by qitrader View Post3) How do i remove the label of the indicator with parameters on the top left corner of my chart?Originally posted by Josh View Post3) I am unaware of a way to do so yet, but it is on the list for future development.
base.Name = "";
to the Initialize() method. You have to remove and re-load your indicator if its already being displayed to get this to work.
This does have the unfortunate side-effect of making the indicator name not display in the indicator list when the Indicators screen is being displayed.
Best regards,
KBJ
Leave a comment:
-
qitrader,
In your earlier post, what is wrong with the points on the picture? You circled some of the bar's low values, but your indicator is just plotting according to if the HMA is rising or falling not based on whether the low is rising or falling. Your original algorithm in your DynamicSR.cs file should work just fine once you get the relationship you were hoping for correct.
Leave a comment:
-
Thanks again Josh.
If I can find a way to integrate the swing indicator algorithm into my code, I think it would work. Any tips/hints on how I can put this together?
Leave a comment:
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
93 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
7 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
||
Started by zstheorist, Yesterday, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Yesterday, 07:52 PM
|
Leave a comment: