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

EnterLongLimit + basic ns functioning

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

    EnterLongLimit + basic ns functioning

    hello Team and Reader,

    Is there not something wrong with the pictures attached ?
    Should the entries not all be occuring after a blue bar ?

    A little bit rusty after a few weeks pause with my strategy building, during this new test I was expecting the entries to only occur when the barbrush is blue (/when the entreembvl() bool condition is met).
    I remember encountering a similar "issue" (should be easily solved) in the past but I need a little help starting the deducing process here. What am I forgetting ?

    (the barbrush() method is just a derivative of BarBrush).
    Attached Files

    #2
    Hello Amedeus,

    From the image you have a condition only for the coloring of the bar, if you wanted the entry to use the same condition you need to add the entry to that condition as well.

    I otherwise would not be able to tell how the script runs just by an image, you would need to add Prints into that area of the script to output the values you are using. By doing that you would be able to see why a condition is working the way it is.

    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      hey Jesse, thank you very much for the help,

      Since you offer, I would gladly have a little more of your assistance, which is much appriciated :

      see the new attachments.
      Side by side in the code are : an EnterLongLimit() order called "EnterLongLimitZzzzzz", and entZz = true; (a bool).
      Still in the code a little bit further is the labAnnexe_longEntrees() method which is only used as a "delegate" to trigger the orders with a bool (EntZz).
      Both orders are the same : EnterLongLimit(Convert.ToInt32(DefaultQuantity), Somedouble, "Somename");

      In the chart attachment of this, we can see the EntZz order still enters regardless of the condition (colored). While the EnterLongLimitZzzzzz order does trigger only when the condition is met (as expected).
      Do you have any idea of what could cause this divergence ?
      I was expecting them both to behave the exact same.
      Attached Files

      Comment


        #4
        Hello Amedeus,

        Again we really won't be able to help with images of code, we cannot execute that in the same use case to know why the logic worked as it did. You could add Print statements to the areas that you are picturing to get a better idea of how the logic you made works.

        Prints are a going to be a huge part of developing NinjaScript, without being able to accurately see what your logic sees you would just be guessing to know why it did or did not do something. Using prints allows you to output the values that the strategy is actually seeing to know why it was or was not true specifically.



        JesseNinjaTrader Customer Service

        Comment


          #5
          hey Jesse, thank you very much,

          A simple print of the bool did always output true.
          This group of bools was actuallly not set as false by default.

          After correcting this, the behavior is back to normal, as the attached chart of the same episode shows.
          Solved !

          have a great day
          Merry Christmas
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Irukandji, Today, 05:50 AM
          0 responses
          1 view
          0 likes
          Last Post Irukandji  
          Started by ageeholdings, Today, 05:22 AM
          0 responses
          5 views
          0 likes
          Last Post ageeholdings  
          Started by llanqui, 04-28-2024, 10:32 AM
          2 responses
          18 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by DroneBlackCa, Today, 05:17 AM
          0 responses
          3 views
          0 likes
          Last Post DroneBlackCa  
          Started by tradingnasdaqprueba, 04-09-2024, 09:52 AM
          7 responses
          50 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X