Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent trading into support or resistance

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

    Prevent trading into support or resistance

    I actually only want to filter out trades that would cross the support or resistance lines. Cant I use CrossAbove or CrossBelow for that?
    Last edited by rafe0304; 06-30-2016, 07:23 AM.

    #2
    Hello rafe0304, and thank you for your question.

    To prevent the managing order from SetProfitTarget from being submitted if its profit target would cross a price point, you could use code such as the following :

    Code:
    [FONT=Courier New]
    int profitTargetTicks = 5; // example
    double myResistanceLine = SMA(14); // example
    
    // this example assumes we enter on the long side of the market
    if(Close[0] + profitTargetTicks * TickSize > myResistanceLine)
    {
      return;
    }[/FONT]
    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks, but that doesnt cover the cases were Close[0] is already below a resistance line. Cant I use CrossBelow for that ?

      Comment


        #4
        Hello rafe0304,

        Since CrossAbove and CrossBelow both have an overload in this form :

        CrossAbove(IDataSeries series1, double value, int lookBackPeriod)

        Provided you pass the price point that the profit target would be at as the value parameter, you can certainly use CrossAbove and CrossBelow to compare your price point to a data series. You will want to use your resistance line as the data series in this example.
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X