Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing PricerMarkers Colors...

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

    Changing PricerMarkers Colors...

    NT7: Code used the switch the a ray at the last price ask or bid.

    NT8: "BarsData.PriceMarkerColor" is gone and I have hunted around in the code and can not find the NT8 replacement code to do this.

    I have similar code in other places that I am doing similar things with so I need access to this behavior.

    Code:
    {
    					Value[0] = newLastPrice;
    					if	(newLastPrice >= bestAsk)
    					{
    					if(bidAskPriceLine)
    					BarsArray[0].BarsData.PriceMarkerColor = askPriceLineColor;
    					Draw.Ray(this, "CurrRay", false, rayLengthLast, newLastPrice, 0, newLastPrice, askPriceLineColor, lineStyleLast, lineWidthLast);
    					}
    					else if	(newLastPrice <= bestBid)
    					{
    					if(bidAskPriceLine)
    					BarsArray[0].BarsData.PriceMarkerColor = bidPriceLineColor;
    					Draw.Ray(this, "CurrRay", false, rayLengthLast, newLastPrice, 0, newLastPrice, bidPriceLineColor, lineStyleLast, lineWidthLast);
    					}
    					else
    					{
    					BarsArray[0].BarsData.PriceMarkerColor = lastPriceLineColor;
    					Draw.Ray(this, "CurrRay", false, rayLengthLast, newLastPrice, 0, newLastPrice, lastPriceLineColor, lineStyleLast, lineWidthLast);
    					}
    				}

    #2
    BarsData and other chart related methods have been moved to the ChartBars class: data series related options you'll find in the bars properties collection:

    ChartBars.Properties.PriceMarker.Background
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you...

      this is just fluff to make the post long enough to post.

      Comment


        #4
        this is the original code from nt7:
        BarsArray[0].BarsData.PriceMarkerColor = askPriceLineColor;

        this bit of code has been been changed and moved into the code just behind the old sample.
        BarsData.PriceMarkerColor => ChartBars.Properties.PriceMarker.Background

        here is the issue that i still have, I have not been able to get the line of code to work to change the price maker colours.

        before in nt7 BarsArray[0] was a part of the solution of code to work to have the marker change in colour. Now I have not been able to find the rest of the logic to put it all together, i have been hunting and pecking but the solution is not apparent, i know the current code base it is possible to switch the price maker as it can be done in chart properties, but to have a indicator do it to match if the ask or the bid is equal to last price, i have not been able to locate intellisense method call, the solution to having the colour change programmatically.

        Thanks.

        Comment


          #5
          The attached script will change the price marker for the primary chart bars that the indicator is running. This is working without issues on my end. Please let me know if this is not working for you, or if there is some concept of your goal I am missing and I'll see what can be done.
          Attached Files
          MatthewNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RubenCazorla, 08-30-2022, 06:36 AM
          3 responses
          77 views
          0 likes
          Last Post PaulMohn  
          Started by f.saeidi, Yesterday, 12:14 PM
          9 responses
          23 views
          0 likes
          Last Post f.saeidi  
          Started by Tim-c, Today, 03:54 AM
          0 responses
          3 views
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Started by FrancisMorro, Today, 03:24 AM
          0 responses
          4 views
          0 likes
          Last Post FrancisMorro  
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,772 views
          0 likes
          Last Post Leafcutter  
          Working...
          X