Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicate Dataseries and Modifie it

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

    Duplicate Dataseries and Modifie it

    Hello
    I have a strategy that works on the primary dataseries that mark the" trigger bar" with a colored arrow after the close of the bar (if the close start the trigger) .
    The close price of the trigger bar is the price of the limit order that have tu be used in order submission.

    I order to avoid slippage and not filling of the order, I would like to know if it is possible :

    1) duplicate the primary dataseries (I think yes)

    2) substitute (in the duplicate dataseries) dinamically the close[0] with a forecast price (this is the main question)

    3) allow strategy to calculate if that forecast price will start the trigger and , if the answer is "YES", submit the limit order with the forecast Price as limit price ( I think it is possibile)

    4) after the bar is closed the previous bar[0] that now is bar[1] have to be (in duplicate dataseries) set like bar [1] of the primary data series and the the new bar[0] modified (with the another forecast price) start the same process explained at point 3

    Forecast price is calculated by another function of the same strategy

    thanks for support
    Roberto




    #2
    Hello truesailor,

    Thanks for your post.

    Yes, you can add a duplicate data series but it would not be needed however you would not be able to change the price of a bar. I think all you really need to do here is to compare the current price to a forecast price and determine if that forecast price will trigger. You may need to run your strategy using Calculate.OnPriceChange so that you are looking at the real-time price (if you are not already).

    You may want or need to separate your logic so that some of it runs on each price change (the forecasting logic) while some of it only runs once per bar. Here is a link to our educational example of this: https://ninjatrader.com/support/help...either_cal.htm

    Comment


      #3
      The Strategy is based on double stochastics that works with a series of close...I could prepare a private series of the close and switch element0 with forecasted price and check the trigger; at the closing of the bar[0]=> that became bar[1], I could substitute element1 of the private series (previous element0) with Close[1] and insert new element0 (new forecast).

      how does it sounds?
      Roberto

      Comment


        #4
        Hello Roberto,

        Thanks for your reply.

        Yes, you can create a private data series (as it would have the same elements as the charts data series) and can assign the close value to it and/or any other value you wish.
        Reference: https://ninjatrader.com/support/help...s/?seriest.htm

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        598 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        557 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        557 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X