Announcement

Collapse
No announcement yet.

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 John Bogui, Today, 03:57 AM
0 responses
4 views
0 likes
Last Post John Bogui  
Started by Dolfan, 12-30-2020, 12:04 PM
9 responses
51 views
0 likes
Last Post timko
by timko
 
Started by condorhero, Yesterday, 09:28 PM
0 responses
13 views
0 likes
Last Post condorhero  
Started by MaraAnkh, Yesterday, 08:44 PM
0 responses
15 views
0 likes
Last Post MaraAnkh  
Started by wooofad, Yesterday, 05:38 PM
0 responses
10 views
0 likes
Last Post wooofad
by wooofad
 
Working...
X