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 Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,294 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X