Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with creating a condition

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

    Help with creating a condition

    Hi,

    Please look at my question below the images.
    2 attachments and 2 questions.
    Attached Files

    #2
    Hello Allen,

    NinjaTrader generally does not provide custom coding services but we are happy to assist in the right direction. Your examples are relatively clear and simple so hopefully these snippets will be useful for you.

    Code:
    if (Close[0] > 80 && Close[0] > Close[1]) //Evaluates whether the current close is greater than 80 and if the current close is greater than the prior close.
    See here for help making price comparisons in the condition builder.
    See here for help making indicator to value comparisons in the condition builder.


    You won't be able to reference the candlestick pattern indicator directly in your strategy, just due to the way the indicator is written. What you can do is edit the indicator to view the conditions for BearishEngulfing. Click Tools > Edit NinjaScript > Indicator > Open CandleStick pattern. You'll find the following lines for BearishEngulfing.
    Code:
     
     
    if (Close[1] > Open[1] && Close[0] < Open[0] && Open[0] > Close[1] && Close[0] < Open[1] && 
    Stochastics(7, 14, 3).D[0] >= 80
    )
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your respond.
      I just wonder if I can build this condition using strategy wizard ?
      Please see the attachment.
      I tried to make the condition work but it didn't come out good,
      I wanted that only down arrows with number 7, appear above the overbought area ( above the top lime color line).
      Please help needed.
      Attached Files
      Last edited by Allen; 07-28-2010, 11:14 PM.

      Comment


        #4
        Please see these help guide articles for assistance with this area of the condition builder:

        See here for help making price comparisons in the condition builder.
        See here for help making indicator to value comparisons in the condition builder.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Please see the attachment.

          Thank you.
          Attached Files

          Comment


            #6
            Hi Allen,

            Unfortunately I can't tell why the results are not working as you expect. It may be helpful to add stochastics in its own pane and use the data window to confirm values. Overlayed as it is makes it difficult to evalute.

            You may also need to add Print() statements to verify values. See here for additional debugging tips.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            65 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            35 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            59 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            62 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            51 views
            0 likes
            Last Post CarlTrading  
            Working...
            X