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

Strategy sync issue

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

    Strategy sync issue

    Hi ,

    I am running 2 different strategies on same Script but on different window. Initially for 30 min it is worked fine where in both strategy place order according to expectation but after some time 30 min order is not placing as expected . Please let me know how to work contineously place signals from each strategy. Attached is screenshot for ref.
    Attached Files

    #2
    Hello shankar.deshapande,

    Thank you for your post.

    We would not recommend running more than one strategy at a time on the same instrument and account combination. This is due to the fact that strategies are not aware of each other and running multiple strategies will usually cause issues with your account position. I'd recommend reviewing this section of our help guide on Account position vs Strategy Position:



    Running two strategies on the same account runs a real risk of your account ending up in an unintended account position. Think of it this way - you have two strategies running on the same account/instrument combo. Strategy 1 enters a trade with a 5 long buy order. The account position and strategy position are now both 5 long. Then Strategy 2 enters a trade, but it enters with a 8 short sell order. So now, Strategy 1 thinks the position is 5 long, Strategy 2 thinks it is 8 short, and the actual account position is 3 short. This causes issues if you do not expect the position you are actually in.

    This can affect what the strategy calculates its position as internally and keep a strategy from taking trades if it thinks it is still in a position but the position was actually closed by an order from a different strategy.

    Further, NinjaTrader does not support hedging.

    We would recommend combining all code for each strategy you want to run on the same instrument and account combination into a single strategy so the overall position can be tracked by the strategy, or running each strategy on a separate account.

    Do you see the strategies in question place trades as you'd expect if you only run one at a time on the same instrument and account?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Even some times with single strategy and single account also i face sync issue where strategy will not run contineously , but after disable and enable again it works fine.

      And Can we read line value from chart and read in strategy to place buy/sell at specified price like when i draw fib extension i want place buy/sell 161.8% automatically .Is it possible?

      Comment


        #4
        Hello shankar.deshapande,

        Thank you for your reply.

        When using only one strategy and it appears to cease running, does the strategy appear disabled? Do any messages related to the strategy appear in the log tab of the Control Center?

        As far as reading values from a manually drawn object like a fib extension, you'd need to loop through the collection of drawing objects on the chart, find your fib extension, get the levels and use that to place the order, which would be a little more advanced programming.

        Here's an example of looping through all the drawing objects on a chart, finding a fib retracement, and printing the levels that should help you with a starting point:

        Code:
         protected override void OnBarUpdate()
        {
        if (DrawObjects.Count > 0)
        {
        foreach (DrawingTool draw in DrawObjects.ToList())
        {
        if (draw is DrawingTools.FibonacciRetracements)
        {
        Print ("Tag name: "+draw.Tag);
        DrawingTools.FibonacciRetracements temp = draw as DrawingTools.FibonacciRetracements;
        
        if(temp != null)
        {
        for(int i = 0; i < temp.PriceLevels.Count; i++)
        {
        Print(i + " " + temp.PriceLevels[i].Value + " " + temp.PriceLevels[i].GetPrice(temp.StartAnchor.Price, temp.EndAnchor.Price - temp.StartAnchor.Price, true));
        }
        }
        }
        }
        }
        }
        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        7 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X