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

Can I program custom indicators based on conditional statements into Ninja Trader?

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

    Can I program custom indicators based on conditional statements into Ninja Trader?

    I am currently on a free trial of Ninja w/CQG data feed. Is it possible to do the following:


    1) Program a custom indicator that is similar to this: If the high of bar one is greater than the high of bar 2 and the close of bar 2 is greater than the mid of bar one.

    ( H[-1]>H[-2] AND C[-2]>MID[-1])

    2) Enable a triangle to show up above the price bar on a sell and below on a buy to signal buying or selling pressure.....and have the triangle updating on a tick by tick basis as the condition is met and true or null and false......essentially the triangle would be flashing on and off as the tick data is updating live and effecting the relevance of the triangle.

    #2
    Welcome to our forums here - yes this would be possible both to custom code in NinjaTrader's NinjaScript - http://www.ninjatrader.com/support/h.../tutorials.htm

    If you're not a programmer, a range of consultants is available to professionally create this code for you -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      sample language

      I think if I had a sample then I could program my inicators in accordingly.

      could anyone translate the following indicator into ninja script, where I would type it into the template........

      if (current bar low <= low of 3 bars ago) and (close of current bar > close of 3 bars ago) then a purple triangle would show up at the bottom of the bar


      in other platforms I have inputted something like this: if(L<=L[-3]) and [C>C[-3])

      Basically, I am not versed in C# computer language. I am struggling with how to input statements containing "AND", IF, HIGH, LOW, OPEN, CLOSE.

      I have been through the tutorials and can set up the indicator....just need help with the script end of things.

      Thank you in advance

      Comment


        #4
        vern13, you could for example give this snippet a try in your custom indicator -

        if (CurrentBar < 3) return;

        if ((Low[0] <= Low[3]) && (Close[0] > Close[3]))
        DrawDot("tag1" + CurrentBar, true, 0, Low[0] - TickSize, Color.Blue);

        Good luck!
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thank you, I will give it a shot!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PaulMohn, Today, 05:00 AM
          0 responses
          7 views
          0 likes
          Last Post PaulMohn  
          Started by ZenCortexAuCost, Today, 04:24 AM
          0 responses
          6 views
          0 likes
          Last Post ZenCortexAuCost  
          Started by ZenCortexAuCost, Today, 04:22 AM
          0 responses
          3 views
          0 likes
          Last Post ZenCortexAuCost  
          Started by SantoshXX, Today, 03:09 AM
          0 responses
          16 views
          0 likes
          Last Post SantoshXX  
          Started by DanielTynera, Today, 01:14 AM
          0 responses
          5 views
          0 likes
          Last Post DanielTynera  
          Working...
          X