Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help With my money Management

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

    Help With my money Management

    Hello Guys:

    I have been trying to do the Money management for my Automatic Startegy. I tought I had the logic Correct but I come u with the attached error right below Print(" Long Money Management!!!!") Statement. The strategy Has not triggered a buy signal yet when it triggers the error. Any idea why I am having this error?
    Thank you very much for your help...
    Attached Files

    #2
    Yandychang, I would expect that print to come through at all times, since it's placed at the beginning of your region before the if checking if you're in a position, so that part would simply always be called and not filtered by any position your script would potentially have.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      yes, thank you for your response, thats not my issue. the issue is that it works up until that point. I put the Print statement there, as well as throughout my code to tell me specifically where my error is when I have one. In this case, right after my statement triggers the error. which if the if stament calling the GetAtmStrategyMarketPosition( atmStrategyId). For some reason, Which I dont know it does not recognize atmStrategyId.

      Is it Possible that since it triggered a short order from another startegy( completely independent from this one) is entering the cycle. But since I have not created an order yet, it cannot find it, this way triggering the error?

      Comment


        #4
        Yandychang,

        You would want to check that atmStrategyId is not null either before or in the if statement where you are accessing GetAtmStrategyMarketPosition()

        Something like if(atmStrategyId != null)
        or
        if(atmStrategyId != null && GetAtmMarketPosition(....

        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          that Did not Fix it...!!! any other suggestions?

          Comment


            #6
            Yandychang,

            Can you please send me your scrip to support so that I can investigate this further?

            Help -> Send to Platform Support

            Put ATTN Cal in the subject and reference this thread in the body.
            Attach your script which is located in (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Strategy
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kevinenergy, 02-17-2023, 12:42 PM
            117 responses
            2,764 views
            1 like
            Last Post jculp
            by jculp
             
            Started by Mongo, Today, 11:05 AM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by SightCareAubetter, Today, 12:55 PM
            0 responses
            3 views
            0 likes
            Last Post SightCareAubetter  
            Started by traderqz, Today, 12:06 AM
            8 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by SightCareAubetter, Today, 12:50 PM
            0 responses
            2 views
            0 likes
            Last Post SightCareAubetter  
            Working...
            X