Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Something Simple

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

    Something Simple

    I have been trying to code a fairly simple statement. However, today does not seem to be my day. Here is what I am trying to do.

    If the entry bar closes as a doji then exit trade.

    Can someone please tell the synatax. For the life of me I am not getting it. It is probably something simple I missed.

    #2
    Hi suburban,

    Have you tried the Strategy Wizard? You can use the Wizard to automatically generate you the code.

    The syntax would be something like this:
    Code:
    if (CandleStickPattern(ChartPattern.Doji, 4).PatternFound[0] == 1)
    {
        ExitLong(DefaultQuantity, "");
    }
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      That's It

      Thanks Josh! That worked. So, if I wanted to close the trade when this triggered at my entry price plus one tick. I would state:

      ExitLongLimit(Open[0] + 1 * TickSize)


      Would that be correct?

      TIA for your help.

      Comment


        #4
        Yup. That should work out for you.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X