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

Stuck with code error

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

    Stuck with code error

    Can someone please help me, I am just learning to write ninjascript and I am stuck with this code. Please can someone assist.

    Please see attached.

    Ryan
    Attached Files

    #2
    Hi Ryan, looks like you would need to comment the checkPositions() call out since it's not defined anywhere in your code, hence the compiler would not know how to interpret it.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks

      Originally posted by NinjaTrader_Bertrand View Post
      Hi Ryan, looks like you would need to comment the checkPositions() call out since it's not defined anywhere in your code, hence the compiler would not know how to interpret it.
      Would you be able to show me how do do this, I am just learning so im struggling

      Comment


        #4
        Sure, the attached file would for example compile, as the erroneous call is commented out.

        Did you already check through our broad range of tutorials for coding?



        If not, then I would highly suggest doing so, it provides a solid base to further more advanced works.
        Attached Files
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I have been through them but I am still stuck with this and have been for days, hopefully someone on here will be helpfull enough to show me axactly how to remidy the errors I have made so I know how to do it going forward.

          I am not a programmer so basicaly need to be tought how to suck eggs..

          Cheers

          Comment


            #6
            Have you looked through the file I posted? This would compile and you could then compare to your own works. You basically called a method (checkPositions()) that never existed, hence the compiler took offense.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks for your help Bertrand. Much appreciated.

              Now I just have tyo figure out why the strategy is not making any trades ;-)

              Comment


                #8
                You're welcome, easiest would be adding to draw a visual object as well on your conditions triggering the entry, this way you have an easy doublecheck when and where exactly they trigger. If you wouldn't see anything drawn, then you would know that none have triggered and you would need to use not as strict rules for example or simplify the condition down to a level when it triggers as you expect and only then add more complexity to the strategy.

                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jclose, Today, 09:37 PM
                0 responses
                5 views
                0 likes
                Last Post jclose
                by jclose
                 
                Started by WeyldFalcon, 08-07-2020, 06:13 AM
                10 responses
                1,413 views
                0 likes
                Last Post Traderontheroad  
                Started by firefoxforum12, Today, 08:53 PM
                0 responses
                11 views
                0 likes
                Last Post firefoxforum12  
                Started by stafe, Today, 08:34 PM
                0 responses
                11 views
                0 likes
                Last Post stafe
                by stafe
                 
                Started by sastrades, 01-31-2024, 10:19 PM
                11 responses
                169 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X