• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Botan626, Today, 04:43 AM
          0 responses
          2 views
          0 likes
          Last Post Botan626  
          Started by xsgex, Yesterday, 09:46 PM
          0 responses
          3 views
          0 likes
          Last Post xsgex
          by xsgex
           
          Started by Steve L, Yesterday, 09:36 PM
          0 responses
          4 views
          0 likes
          Last Post Steve L
          by Steve L
           
          Started by krugman25, Yesterday, 09:34 PM
          0 responses
          4 views
          0 likes
          Last Post krugman25  
          Started by indy73, Yesterday, 04:42 PM
          0 responses
          15 views
          0 likes
          Last Post indy73
          by indy73
           
          Working...
          X