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

Managed vs Unmanaged

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

  • localappleseed
    replied
    Yes, per your guideline, it worked! But it looks like I have to remove, shutdown and re-start Strategy to make it work. Removing and reapply Strategy was not enough.
    Thanks a lot.

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello localappleseed,

    If you just made that change but didn't remove/re apply the strategy you would see that error. Any changes to your strategies SetDefaults or its Class structure like user inputs would require re applying it.

    I look forward to being of further assistance.

    Leave a comment:


  • localappleseed
    replied
    I got the following errors even I declared IsUnamanged = true. I am not sure why it is still in managed?
    Error on calling 'OnBarUpdate' method on bar 0: Strategy 'LLL2/212851947': 'SubmitOrderUnmanaged' method can't be called on managed strategies.

    protected override void OnBarUpdate()
    {
    ...
    myExit = SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.Limit, 100, GetCurrentAsk()+0.1, 0, "", "Buying 100");
    ...
    }

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello localappleseed,

    The OnStateChange override is defined in every strategy so each one will have its own individual SetDefaults state. In this example, this specific strategy would be unmanaged. All other strategies which don't have IsUnmanaged = true; defined in their code won't be managed by default.

    When you set variables like this it will have no effect on other strategies, this is being set only for that one strategy.

    I look forward to being of further assistance.

    Leave a comment:


  • localappleseed
    started a topic Managed vs Unmanaged

    Managed vs Unmanaged

    I am using an unmanaged Strategy to handle special situation while other Strategies are managed. So I have both managed and unmanaged Strategies defined, of course I won't use them at the same time. For this special unmanaged strategy, I have to declare this:

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    IsUnmanaged = true;
    }
    }


    The problem is, OnStateChange() can be called for all Strategies either managed or unmanged, in other words, IsUnmanaged can be set to either "true" or "false". How do I resolve it? Thanks.

Latest Posts

Collapse

Topics Statistics Last Post
Started by josh18955, 03-25-2023, 11:16 AM
6 responses
436 views
0 likes
Last Post Delerium  
Started by FAQtrader, Today, 03:35 PM
0 responses
5 views
0 likes
Last Post FAQtrader  
Started by rocketman7, Today, 09:41 AM
5 responses
18 views
0 likes
Last Post NinjaTrader_Jesse  
Started by frslvr, 04-11-2024, 07:26 AM
9 responses
127 views
1 like
Last Post caryc123  
Started by selu72, Today, 02:01 PM
1 response
14 views
0 likes
Last Post NinjaTrader_Zachary  
Working...
X