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 Perr0Grande, Today, 08:16 PM
          0 responses
          2 views
          0 likes
          Last Post Perr0Grande  
          Started by elderan, Today, 08:03 PM
          0 responses
          5 views
          0 likes
          Last Post elderan
          by elderan
           
          Started by algospoke, Today, 06:40 PM
          0 responses
          10 views
          0 likes
          Last Post algospoke  
          Started by maybeimnotrader, Today, 05:46 PM
          0 responses
          12 views
          0 likes
          Last Post maybeimnotrader  
          Started by quantismo, Today, 05:13 PM
          0 responses
          7 views
          0 likes
          Last Post quantismo  
          Working...
          X