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

Order Hanling

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

    Order Hanling

    Hello. Im developping a strategy and i have a problem. Im trying to control de Order and i entry with this sentence:

    LongOrder = EnterLong(GCContratos,
    "LongOrder");

    If i run the strategy in a graph all ok. it marks all de entry-exit positions in the graph.

    But if i add this code to my strategy:

    protectedoverridevoid OnExecution(IExecution execution)
    {
    Print(execution.ToString());
    }

    then all the entries-exits dissapear and it seems as if it have had only a entry that it is until the end of the graph.

    Can you help me?. Thanks.

    #2
    Hello alibanez,

    Can you please share the complete code snippet you're using? That block shouldn't be doing much and is not likely interfering unless you have it structured in the wrong place.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Order hanling 2

      I have attached the strategy. My goal is to program a general body of stratety for trying in the future different cases. Thanks.
      Attached Files

      Comment


        #4
        Hello alibanez,

        You have an additional method called in this block. You'll have to debug this to verify it's working as you expect.

        GestionCapital()

        Help for debugging your strategy is available here:
        Debugging your NinjaScript Code
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Perfect. If i dont call 'GestionCapital()' it works. Thank you. Do you have some idea about what cat it happening in this method?

          Comment


            #6
            It looks like this method does some money management and assigns the number of contracts to be traded. Use plenty of Print() statements to verify all values here.

            Follow this sample for help with performance class:
            Using trade performance statistics for money management
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              I'll see it. Thank you very much.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              0 responses
              2 views
              0 likes
              Last Post andrewtrades  
              Started by chbruno, Today, 04:10 PM
              0 responses
              3 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              6 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X