Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

can anyone help with my strategy?

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

    can anyone help with my strategy?

    how to create a strategy like following.
    condition if
    bar.close[0] > bar.high[1]
    bar.open[0] < bar.low[0]+ 1/3 (bar.high[0] - bar.low[0])
    bar.close[0] > bar.low[0] + 2/3 (bar.high[0] - bar.low[0])
    do
    up arrow

    (any video tutorial for strategy development? sorry , i am a rookie )
    Last edited by peterhxu7; 04-04-2014, 01:08 AM.

    #2
    Hi Peter, thanks for the post and welcome to our forums - I'll have our NinjaScript trainee take a look at your inquiry and we be back shortly with getting started help on that path.

    Comment


      #3
      Hello there peterhxu7,

      Glad to see you’re trying out Ninjascript!

      Here a couple of great links that could be valuable to you.

      The first is the link to Automated Strategy Development Level 1 - This is a recorded webinar that has very useful information about strategy development.


      This link is to our YouTube channel where we have multiple videos on NinjaTrader.


      And lastly this link is to the NinjaTrader help guide, on the left if you double click the Ninjascript section you can find a full reference to Ninjascript


      For beginning i would recommend setting up scripts using the wizard that is provided in NinjaTrader. It makes it easy by starting a template with the inputs and variables you enter then you can unlock the code and add what you want. Here is a link to some information on the wizard.


      As for your example

      Code:
      if
      bar.close[0] > bar.high[1]
      bar.open[0] < bar.low[0]+ 1/3 (bar.high[0] - bar.low[0])
      bar.close[0] > bar.low[0] + 2/3 (bar.high[0] - bar.low[0])
      do 
      up arrow
      this would be one way to accomplish this in NinjaScript
      Code:
      protected override void OnBarUpdate()
              {
      			//gets 1/3 and 2/3
      			double oneThird = (High[0] - Low[0]) / 3;
      			double twoThirds = ((High[0] - Low[0]) / 3) * 2;
      			
      			//if statement to draw arrow
      			 if(Close[0] > High[1] && Open[0] < Low[0] + oneThird && Close[0] > Low[0] + twoThirds)
      			{
      				DrawArrowUp("arrowName" + CurrentBar, 0, High[0], Color.Green); 
      				// draws a up arrow with the color of green at High[0] 
      			}
              }


      Please let us know if you need additional help in the future.
      Last edited by NinjaTrader_Jesse; 04-04-2014, 07:53 AM.

      Comment


        #4
        thanks a lot

        Comment


          #5
          got it now , thanks
          Last edited by peterhxu7; 04-06-2014, 11:33 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X