Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RC2: SetProfitTarget (and SetStopLoss) crash the strategy

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

    RC2: SetProfitTarget (and SetStopLoss) crash the strategy

    Hello!

    I created strategy and it works ok on Win7 32 bit, but today I tried it on Win server 2012R2 64 bit (both in 32 and 64 bit Ninjatrader) and I could not enable the strategy on the chart.

    After debugging in VisualStudio, I found out that it crashes on the call of SetProfitTarget() method (it's called in OnStateChange as suggested in docs).

    The result is System.FormatException in mscorlib.dll, no matter what value I use in the method arguments.

    Originally I call it like this:
    Code:
    SetProfitTarget(CalculationMode.Pips, 20);
    The same situation is with SetStopLoss() call.

    Do you have any thoughts what is wrong and how to fix it?

    Thanks!

    #2
    Originally posted by alextop View Post
    Hello!
    Originally I call it like this:
    Code:
    SetProfitTarget(CalculationMode.Pips, 20);
    The same situation is with SetStopLoss() call.
    I have more info about the issue. It seems to happen only when I change language of the Ninjatrader, setting not English (definitely falls in Russian).

    Maybe this can help.

    Comment


      #3
      Hello alextop,

      Thanks for your post.

      Can you provide your strategy and the steps you followed to create the crash condition? If not the full strategy then a portion of the strategy that will demonstrate the error?

      If you would prefer, please send the sample strategy to PlatformSupport[at]NinjaTrader[dot]Com, mark the e-mail Atten:Paul and a link to this thread.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Paul View Post
        Hello alextop,

        Thanks for your post.

        Can you provide your strategy and the steps you followed to create the crash condition? If not the full strategy then a portion of the strategy that will demonstrate the error?

        If you would prefer, please send the sample strategy to PlatformSupport[at]NinjaTrader[dot]Com, mark the e-mail Atten:Paul and a link to this thread.
        There is actually nothing fancy in that strategy because that call is very early in the code, so all according to docs - set stop loss in State.Configure phase. Just run it in Russian version of the Ninjatrader8. In Egnlish version the error does not happen.

        I'll try to send the sample to email a bit later.

        Thanks!

        Comment


          #5
          Hello alextop,

          Thanks for your reply.

          I created a strategy with only stoploss and profit target and have not observed an issue, switching from English to Russian and back, running the strategy in both, several times and of course shutting NT8 down and restarting.

          I am seeing an error message, when starting in Russian that translates to "Strategy 'NinjaTrader': Error in loading the trading hours of the database".
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          388 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          31 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by yertle, Yesterday, 08:38 AM
          7 responses
          29 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by bmartz, 03-12-2024, 06:12 AM
          2 responses
          22 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by funk10101, Today, 12:02 AM
          0 responses
          7 views
          0 likes
          Last Post funk10101  
          Working...
          X