Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Muli-time-frame and dataseries

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

    Muli-time-frame and dataseries

    I am trying to sync up a dataseries object with a second time frame object....

    d2SeriesOpen = new DataSeries(SMA(Open(BarsArray[1],20)));

    This code is not working as it gives me an error " The Name open does not exist in the current context"

    I am trying to just take the SMA of the close and open of my second data time frame.

    New at this...trying to convert our strategies from MC to ninja.

    #2
    You will not be able to sync it to Open(BarsArray[1]) like that. If you want the open series of the secondary Bars object you would instead use Opens[1] where the [] is the Bars index you want to use.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Another question. I have a system that trades on 15 min bars and on 5 min bars. The 5 min bars being data 2 (index 1). When i am programming within the barsinprogress ==0 method does this mean that the evaluations below this method are only being computed on the 15 min bars even if Calculateonbarclose=false?

      I would like to trade on the 15 min bars but i also would like to be able to simulate backtesting at lib=1 like in multicharts. The 5 min bar is a secondary indicator. I have a few indicators on the 15 min bars, and a few on the 5 min bars, when they all are true i want the order to execute.

      in MC i would have done something like

      if close > close[1] then condition 1=1 else condition1=0;
      if blah blah = blah blah then condition2=1 else condition2=0;
      etc etc etc

      Then a final order entry of if condition 1 and condition 2 and etc etc etc then enterlong()

      Is this possible in c#, maybe a hint in the right direction would help a lot!

      I am still trying to figure out where to put the code or how its affected with the barsinprogress method being called with multitime frame systems as well. Like if i reference a barsarray number of index 2 but that code is within the barsinprogress==0 method will it still calculate correctly?

      I know there is a lot of questions here, just trying to get our first system converted from MC so i can go LIVE.

      Comment


        #4
        neb1998, if you are running with CalculateOnBarClose = false, each data series will show the most recent close at the same time. The difference is in other data points of the bar.

        When you are in the BarsInProgress == 0, then everything you are dealing with is 15 minute data. When you are working in BIP == 1, then everything will be based off of the 5 minute data.

        Please take a look at the SampleMultiTimeFrame sample for additional information.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        3 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Working...
        X