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 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.
    BertrandNinjaTrader Customer Service

    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.
      Download NinjaTrader FREE at http://www.ninjatrader.comThis video is a recording of our live "Automated Strategy Development Level 1" webinar covering the to...


      This link is to our YouTube channel where we have multiple videos on NinjaTrader.
      Recordings of our daily NinjaTrader product training webinars.


      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.
      JesseNinjaTrader Customer Service

      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 Balage0922, Today, 07:38 AM
          0 responses
          5 views
          0 likes
          Last Post Balage0922  
          Started by JoMoon2024, Today, 06:56 AM
          0 responses
          6 views
          0 likes
          Last Post JoMoon2024  
          Started by Haiasi, 04-25-2024, 06:53 PM
          2 responses
          19 views
          0 likes
          Last Post Massinisa  
          Started by Creamers, Today, 05:32 AM
          0 responses
          6 views
          0 likes
          Last Post Creamers  
          Started by Segwin, 05-07-2018, 02:15 PM
          12 responses
          1,786 views
          0 likes
          Last Post Leafcutter  
          Working...
          X