Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Basic strategy development check

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

    Basic strategy development check

    Hey NinjaTrader.
    First of all, kudos on the great platform. I really appreciate this support forum. I've been using it a lot. You guys a f*cking great.

    So, I'm new to strategy development. I have my own strategy I employ in real time trading which works which I am now translating to automation. It's simple and easy, but with no coding experience, I am just making sure I am doing so correctly.
    I'm using the Wizard.

    First of all, I am using renko charts with a simple indicator that measures how many minutes it takes for each bar to complete. My first condition is:
    If a bar completes in under 2 minutes: condition met.

    So. Barspeed:
    Input series: close.
    Plot: timepast
    Bars ago: 0
    Offset type: ticks
    offset: 0
    plot on chart: false

    then:
    <=
    user defined input: a double set to: 2.000


    I would prefer to not unlock the code and flesh this all out in wizard.
    If you can confirm or deny if this is legitimate, that would be marvelous.

    Thanks in advance, I really appreciate it.

    #2
    Hello Leviathan,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    If you can access the indicator from within the Strategy Wizard under the Conditions and Actions, then yes this is possible.

    Please let me know if you have any questions.

    Comment


      #3
      Thanks mate! You're a legend!

      I'm trying to counter a problem with a trailstop not registering until a bar close.

      Preferably, I would have my stoploss calculating tick by tick.
      I've done some research throughout the forum and found the 'FirstTickOfBar' option, which would be great. This is still a tad beyond me, but I've followed what I've found.
      I have CalculateOnBarClose = false.

      This is what I've got so far but I keep getting errors:
      Saying I need to close out the second && condition with a ' ; ', which I then do to create more errors.

      protected override void OnBarUpdate()
      {
      // Condition set 1
      if (FirstTickOfBar)
      {
      (BarSpeed(Close).TimePast[1] <= Minutes
      && Open[1] < Open[0]
      && Open[2] < Open[1])
      }
      {

      EnterLong((int) (EntryBuy), "LongJohn");

      }

      Is this correct execution?

      Thank you,
      It's very appreciated

      Comment


        #4
        Hello Leviathan,

        Thank you for your response.

        You would enter that condition in the following context:
        Code:
        // Condition set 1
        if (FirstTickOfBar
        && BarSpeed(Close).TimePast[1] <= Minutes
        && Open[1] < Open[0]
        && Open[2] < Open[1])
        {
        EnterLong((int) (EntryBuy), "LongJohn");
        }

        Comment


          #5
          You're a ****ing champion, Patrick!
          I swear I'll fly to NinjaTrader Headquarters and buy you a whiskey!

          That should be all I need for now.
          I really appreciate it.
          Have a good one.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X