Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve first bar which is shown in the chart

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

    Retrieve first bar which is shown in the chart

    Hello !

    I would like to know if there is any keyword to get the first bar shown of the chart (not the first bar loaded or the first bar of the session), and how to get data from another asset than the primary chart when using this :

    Code:
    [COLOR=#add8e6]
    [/COLOR][COLOR=black]protectedoverridevoidOnMarketData(MarketDataEventArgsmarketDataUpdate)
     {
     
     if (marketDataUpdate.MarketDataType == MarketDataType.Last)
     {
     }
     
     }[/COLOR]
    Thanks !

    #2
    ChartBars.FromIndex will give you the first bar that is painted on the chart. This value you change dynamically as you scrolled or changed the scale of the chart. This will only provide the primary chart bars:



    Regarding your onmarketdata question, are you using AddDataSeries() to get in another asset? If so, you can use BarsInProgress to filter data...

    Code:
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				Name = "MyCustomIndicator2";
    				
    			}
    			else if (State == State.Configure)
    			{
    				AddDataSeries("AAPL", BarsPeriodType.Minute, 1);
    			}
    		}
    	
    		protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    		{
    			
    			if(BarsInProgress == 0)
    			{
    				Print("MSFT price is " + marketDataUpdate.Price);	
    			}
    			
    			else if (BarsInProgress == 1)
    			{
    				Print("AAPL price is " + marketDataUpdate.Price);	
    			}
    		}
    MatthewNinjaTrader Product Management

    Comment


      #3
      Perfect thanks Matthew !

      Well just another quick question : my candles stop showing after 19h00 (Euro hours) while I don't set anything in "trading hours" and just show again when I re-open the Platform after 19h00 (So I got a gap between 19h and the moment I open the plat).
      Do you have any idea where it's coming from ? I get this on different asset and timeframe.

      Comment


        #4
        There are some known issues that are confirmed fixed in the upcoming beta 7 release, but I'll need more specifics to ensure that your case is covered under those fixes.

        What session template are you using?

        Is the data properly reflected in Tool-> Historical Data?
        MatthewNinjaTrader Product Management

        Comment


          #5
          I do not use a particular session template

          Yes if I download data they are properly reflected in the data tools

          In how many days can we expected this next release ?

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          11 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          1 view
          0 likes
          Last Post port119
          by port119
           
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          3 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          2 views
          0 likes
          Last Post 00nevest  
          Started by Jonafare, 12-06-2012, 03:48 PM
          5 responses
          3,986 views
          0 likes
          Last Post rene69851  
          Working...
          X