Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja SampleMultiTimeFrame

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

    Ninja SampleMultiTimeFrame

    Its hard coded with 5 min and 15 min.

    I want to run a back test with 1 min data within a daily candle.
    What exactly is the 5 min and 15 min representing and if it solves my 1 min and daily what do I need to change in the hard code sample?

    The next issue is when I run the back test for the 2 time frames I want to use, what does one use in the Data series for plotting the chart?

    thanks

    #2
    Hello 35trader,

    The 5 and 15 Minutes represent a Data Series like on a chart so there are going to be different ways you can look at the data.

    You would not be able to change the "SampleMultiTimeFrame" strategy but you can create a new strategy based on this code. You may do this by going to the Control Center -> Tools -> Edit NinjaScript -> Strategies. Then double left click on the indicator that you want to have the original code from for example the "SampleMultiTimeFrame". It will then open up the source code for the strategy. Right click inside the window and select Save As. Type in a name of your choosing then press "Save". Press the "OK" button as NinjaTrader will automatically rename them for you. Now you have a new strategy based off the sample one that you can modify.

    For example if you wanted to add a 1 minute and a Daily data to your strategy:

    Code:
    protected override void Initialize()
    {
        // Add a 1 minute Bars object to the strategy
    	Add(PeriodType.Minute, 1);
    			
        // Add a 1 Day Bars object to the strategy
    	Add(PeriodType.Day,1);
    }
    You use what type of Data that you want view, so it does not matter to much but if you want to set it to a 1 minute Data Series you do not have to add this into the strategy.

    Here is another good resource that goes over the Multi-Time Frame approach that you may read for more information.


    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    160 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    9 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X