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

Strategy only drawing one arrow

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

    #16
    Hello sergey_z,

    Thanks for your posts.

    I will update this thread later this morning.

    Thanks in advance for your patience.
    Paul H.NinjaTrader Customer Service

    Comment


      #17
      Hello sergey_z,

      Thanks for your patience.

      I've attached a couple of screenshots that show a strategy test script and the results of that script in the chart and on the output window.
      The script store the values of +1 or -1 in the private data series referencing the same bar as when the cross condition occurs. Once connected to realtime (meaning all of the history has been processed) the code then iterates over the private data series to provide the information if there was a cross, as illustrated in the output window.


      Click image for larger version

Name:	sergey_z-1.PNG
Views:	96
Size:	151.3 KB
ID:	1050639
      Click image for larger version

Name:	sergey_z-2.PNG
Views:	84
Size:	66.2 KB
ID:	1050640

      Paul H.NinjaTrader Customer Service

      Comment


        #18
        Thanks a lot. Its an amazing example!
        Last edited by sergey_z; 03-07-2019, 01:50 PM.

        Comment


          #19
          Please explain me how I can collect/analyze cross for next use not for Output?
          I need to know date,time and OHLC of Daily Bar when SMAs was crossed.

          What is the best idea for this task?

          Thanks a lot!

          Comment


            #20
            Hello sergey_z,

            Thanks for your reply.

            With the code example I posted, you can search through the data series as I did for the print statements and add additional if statement(s) where if the value of the data series crossDetect is +1 or -1 then you can assign the Time or date of that bar and OHLC values from the barsago where the +/- 1 value exists (assuming you apply it to a chart of daily bars). For example, if in the search the last positive cross was 23 bars ago you would access like Time[23], High[23], Low[23], Close[23], Open[23]. The key is once you have a barsago value then you can access the price and time series where the crosses occurred.

            Even though I have previously provided a brief code example, you will need to code your own script as we do not provide coding services If this is beyond your skill/knowledge please keep in mind that you can always hire a programmer skilled in Ninjascript and if requested we can provide references links to such programmers.

            Paul H.NinjaTrader Customer Service

            Comment


              #21
              Hello, I am trying to do the same thing, but ran into issues similar to what was described in this post. When I tried to access the links with the video and other references, I am getting Page Not Found and that the Video format is not supported. I am on Windows 10 machine with the latest Firefox browser. I am using Ninjatrader 8.1.2.1 64-bit

              I created a strategy and converted it into indicator using the wizard - I added the conditions I want to see the indicator to show arrows when conditions are met.

              This works only for the latest condition. All the prior conditions when met do not have those signals. From the post I gather that "the tag name needs to be unique to see all occurrences". Can you help me how I should change the code to see all occurrences on the chart where conditions are met with the arrows?

              Thanks for your help!

              Comment


                #22
                Hello stockbux,

                I tried the video and it appears to work, you can also use the following link to access the file directly:



                To make a tag unique you can add the CurrentBar to the tag. If you are manually coding that would look like the following:

                "MyTag" + CurrrentBar
                JesseNinjaTrader Customer Service

                Comment


                  #23
                  Thank you, Jesse. I will try those.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by judysamnt7, 03-13-2023, 09:11 AM
                  4 responses
                  59 views
                  0 likes
                  Last Post DynamicTest  
                  Started by ScottWalsh, Today, 06:52 PM
                  4 responses
                  36 views
                  0 likes
                  Last Post ScottWalsh  
                  Started by olisav57, Today, 07:39 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post olisav57  
                  Started by trilliantrader, Today, 03:01 PM
                  2 responses
                  21 views
                  0 likes
                  Last Post helpwanted  
                  Started by cre8able, Today, 07:24 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post cre8able  
                  Working...
                  X