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

Whats wrong with my strategy? (Limit Orders)

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

    Whats wrong with my strategy? (Limit Orders)

    This is Long
    EnterLongLimit(DefaultQuantity, (GetCurrentBid(Default input) + (Buy_Limit * TickSize)) , "");
    This is Short
    EnterShortLimit(DefaultQuantity, (GetCurrentAsk(Default input) + (Sell_Limit * TickSize)) , "");

    The default number for Buy_Limit is -10
    The default number for Sell_Limit is 10

    I keep getting errors

    #2
    Hello rickyblah12,

    What are the errors that you are seeing?

    The only item I can see is that normally you would subtract the long value rather than using the negative value like this, but as long as that is calculating to a price lower than the close it should be able to work.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello rickyblah12,



      The only item I can see is that normally you would subtract the long value rather than using the negative value like this, but as long as that is calculating to a price lower than the close it should be able to work.
      what do you mean...can you show me how it would look so I can see

      Comment


        #4
        Hello rickyblah12,

        You would just use a negative symbol instead of a plus symbol to subtract the positive value, you are using a negative value which should accomplish the same task. I only noted that because it is different than what we usually see however if you are certain that is calculating a valid price it shouldn't matter.

        What errors are you getting? Without that detail we are just guessing at what may be wrong, the error should contain a specific reason and can let us know if it relates to the code you have shown.



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello rickyblah12,

          You would just use a negative symbol instead of a plus symbol to subtract the positive value, you are using a negative value which should accomplish the same task. I only noted that because it is different than what we usually see however if you are certain that is calculating a valid price it shouldn't matter.
          how can i do that on the strategy builder?

          Comment


            #6
            these are the errors

            Comment


              #7
              Hello rickyblah12,

              Thank you for providing the error.

              When using the managed approach I would not expect an oco to be reused. Can you attach a sample strategy that demonstrates this happening so that I can review this? If you have logic which is generating an error about OCO I would want to collect the syntax and steps used to see that so we can understand why.

              If the strategy builder is what is generated the prices that would be fine you don't need to change anything but I would still want to see what you made to explore the error.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                I used the strategy builder...how can I stop this from happening then?

                Comment


                  #9
                  Hello rickyblah12,

                  I understand and I am trying to help, however I would still need a sample of the strategy to continue. Can you attach the strategy for review?

                  You can attach the strategy file from the folder Documents\NinjaTrader 8\bin\Custom\Strategies

                  Please let me know if I may be of additional assistance.

                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  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
                  44 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  20 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  10 responses
                  180 views
                  0 likes
                  Last Post jeronymite  
                  Started by DanielSanMartin, Yesterday, 02:37 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post DanielSanMartin  
                  Working...
                  X