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

Access Strategy and Bars objects for custom analysis class

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

    Access Strategy and Bars objects for custom analysis class

    Brief explanation:

    I'm trying to create an analysis class to generate test data and access strategies to test the generated data.
    I don't know of anywhere that has full documentation about the Bars and Strategy classes so I'd be able to fill the Bars object with generated data and then enable the strategy for testing on the generated data.

    I'd love to further explain if necessary for any guidance.

    Thanks for any response.

    #2
    Hi Lumbeezlk thanks for posting. There is no supported way of generating a custom Bars object. The Series<T> is the data structure to use if you need to fill in custom data for each bar in the series the strategy is running on:


    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_ChrisL If I do this, is it possible to enable the strategy to use the data in the Series<T> data structure and simulate trades?

      Comment


        #4
        Hi Lumbeezl, You can calculate trade signals based on the values of the Series<t> array. e.g. Most indicators, like the SMA object can take any Series<double> as input:

        var x = SMA(MySeries, 14)[0] //latest average of the custom Series object.

        All strategies run off an underlying data series i.e. the BarsArray[] object, so the strategy needs to be attached to a data series either through a Chart, the Strategies tab of the Control Center, or the Strategy Analyzer.

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        7 views
        0 likes
        Last Post TraderBCL  
        Started by martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        471 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X