Announcement

Collapse
No announcement yet.

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.

    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

        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.

            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.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                605 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                351 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                560 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                561 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X