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 Segwin, 05-07-2018, 02:15 PM
              14 responses
              1,788 views
              0 likes
              Last Post aligator  
              Started by Jimmyk, 01-26-2018, 05:19 AM
              6 responses
              837 views
              0 likes
              Last Post emuns
              by emuns
               
              Started by jxs_xrj, 01-12-2020, 09:49 AM
              6 responses
              3,293 views
              1 like
              Last Post jgualdronc  
              Started by Touch-Ups, Today, 10:36 AM
              0 responses
              12 views
              0 likes
              Last Post Touch-Ups  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              11 responses
              62 views
              0 likes
              Last Post halgo_boulder  
              Working...
              X