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!
See more
See less

Partner 728x90

Collapse

Dynamic Support and Resistance lines using HMA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • APat1
    replied
    Missed two statements
    changed CurrentBar<3 to period
    Added Average Plot

    Hope this helps

    Pat
    Attached Files

    Leave a comment:


  • qitrader
    replied
    Attached is what I made and algorithm doesn't seem correct. Hope someone can help.

    Thanks

    Q
    Attached Files

    Leave a comment:


  • KBJ
    replied
    Try adding curly braces around the 2 statements after each if condition, like this...

    Code:
    if (condition)
    {
       statement1;
       statement2;
    }

    Leave a comment:


  • qitrader
    replied
    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];
    thanks

    Q

    Leave a comment:


  • APat1
    replied
    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:


  • APat1
    replied
    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

    Pat1
    Last edited by APat1; 11-07-2007, 05:29 PM.

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Maybe try
    Code:
    Swing(5).SwingHighBar(0, 1, CurrentBar)
    Swing(5).SwingLowBar(0, 1, CurrentBar)
    That will return which bar the last high/low were for the swing

    Leave a comment:


  • qitrader
    replied
    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:


  • NinjaTrader_JoshP
    replied
    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:


  • prostyle
    replied
    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:


  • NinjaTrader_JoshP
    replied
    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:


  • qitrader
    replied
    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:


  • KBJ
    replied
    Originally posted by qitrader View Post
    3) How do i remove the label of the indicator with parameters on the top left corner of my chart?
    Originally posted by Josh View Post
    3) I am unaware of a way to do so yet, but it is on the list for future development.
    You could try adding

    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:


  • NinjaTrader_JoshP
    replied
    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:


  • qitrader
    replied
    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 GussJ, 03-04-2020, 03:11 PM
11 responses
3,227 views
0 likes
Last Post xiinteractive  
Started by andrewtrades, Today, 04:57 PM
1 response
13 views
0 likes
Last Post NinjaTrader_Manfred  
Started by chbruno, Today, 04:10 PM
0 responses
7 views
0 likes
Last Post chbruno
by chbruno
 
Started by josh18955, 03-25-2023, 11:16 AM
6 responses
440 views
0 likes
Last Post Delerium  
Started by FAQtrader, Today, 03:35 PM
0 responses
12 views
0 likes
Last Post FAQtrader  
Working...
X