Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Avoiding Buy triggers near resistance

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

    Avoiding Buy triggers near resistance

    I was trying to come up with a way to create a strategy so that buys are avoided near strong resistance areas. Im noticing that is a weakness in my strategy. Its seems this would be difficult to do. Was thinking to have the program automatically create resistance lines based on certain criteria and have it avoid purchases within a certain distance of the resistance line. Anyone have any pointers for acheiving this or has successfully created a method for this type of strategy?

    #2
    zachj, I would not be aware of a full example strategy for this type of filtering already available, but generally as idea you could structure it like the below : this would take the daily Pivot point as sup / res value and have a no trade entry zone around it of 4 ticks...

    Code:
    		protected override void OnBarUpdate()
    		{
    			if (CrossAbove(SMA(Fast), SMA(Slow), 1) && PivotEntry())
    			    EnterLong();
    			else if (CrossBelow(SMA(Fast), SMA(Slow), 1) && PivotEntry())
    			    EnterShort();
    		}
    		
    		private bool PivotEntry()
    		{
    			double pivot = Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 1).PP[0];
        		
    			if (Close[0] > pivot + 4 * TickSize || Close[0] < pivot - 4 * TickSize) 
    				return true;
    			
    			else return false;
    		}

    Comment


      #3
      Ok thanks. I was reading about the Pivot command in the guide but I don't see how exactly the Pivot point is calculated, does it take the average price over a certain period or something to that effect?

      I assume you can have it print the resistance line with a print command somehow?

      Comment


        #4
        zachj,
        Can see this post for details on how pivots are caluclated. Yes, can print or chart the built in pivots indicator to check its values.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X