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

Need strategy indicator converted to an actual indicator. Need help.

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

    Need strategy indicator converted to an actual indicator. Need help.

    Greetings NT Coders..

    I've got a really simple snippet of code written in NT7 for a strategy that's actually an indicator. Long story short, I basically started writing strategy code (some really simple strategies) and I found I could fairly easily program simple on-screen strategies as indicators but never bothered to study how to do that as an actual indicator. Does that make any sense? Anywho-I really don't want to go through the learning curve right now, would anyone be kind enough to "convert" this to an indicator for me, it's super simple I promise.

    Next time you're in Denver-first round's on me!

    BWT-Has anybody taken a course from the LWU?

    jDog
    Attached Files

    #2
    jimdog42, looks the script was actually unlocked and then amended by the editor? From a quick review it should be very straightforward to setup as indicator, just create yourself an empty indicator through the wizard (New NinjaScript > Indicator) and then copy over the Variables, Initialize and OnBarUpdate parts from your strategy. Hit F5 to compile everything in and you should be good to go.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      Oh, believe me, I've tried that very idea, and it won't compile w/o an error, and I'm certain I'm missing something really small like most things with coding, but for whatever reason I can't put my finger on it. This wouldn't be an issue, but as you know, I can't run the chart trader with a strategy running therefore I need it as an indicator.

      Comment


        #4
        I see jimdog42, as a courtesy please find the logic as indicator attached for review, I've made sure overlay is set to true so its plots right on the price panel for your signals.
        Attached Files
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Ah... I'll spare you the details on what I was doing wrong now that I look at this.

          Thank you

          jDog

          Comment


            #6
            .... and now that I've compiled and run the code, it does exactly what it did when I tried to convert it, which is nothing. So there must be a little more to it than lift and replace.

            Grrrr

            Comment


              #7
              Worked for me here in a quick test - any log errors you get when applying that study?

              You might need to add a CurrentBars check in for the indicator.

              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              23 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              45 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              22 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              181 views
              0 likes
              Last Post jeronymite  
              Working...
              X