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

custom shaped price marker using SharpDX?

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

    custom shaped price marker using SharpDX?

    Is there a way of dynamically changing just the color of the price marker of the current close (preferably using fromArgb or SharpDX.color4) while hiding the price markers of all indicators from within the script of a custom indicator?

    So the question is in two parts:

    1. How does one hide indicator price markers while leaving the price marker of the current close intact?

    2. To set the color of the current close price marker on a tick by tick basis?

    3. Means of drawing a custom shaped price marker using SharpDX?
    Last edited by bkinvent; 08-30-2017, 12:46 AM.

    #2
    Hello bkinvent,

    Yes it can be done. Simply override the FormatPriceMarker with your own code. For example,

    Code:
            public override string FormatPriceMarker(double price)
            {
                 return price.ToString("N0");
            }
    This will do some of it. Do you really need to draw custom price marker shapes?

    Comment


      #3
      Hello,

      Thank you for the post.

      Hiding a indicators markers can be achieved using the PaintPriceMarkers property, this would leave the DataSeries price marker but hide the indicators.


      Alternatively, making a plot Transparent will hide its marker and leave other plots markers visible.

      To set a color for the price marker on the current tick, you would need to set the PlotBrushes Brush:
      Code:
      PlotBrushes[0][0] = Brushes.Orange;
      which would produce a result like the following if you were toggling colors: https://puu.sh/xnk5a/9d94fe6c48.png

      Because this has a BarsAgo index, you can always reset the prior bars brush to something that will match the remainder of the plot so only the current bar is being toggled.

      Currently, there is no way to modify or otherwise draw custom markers, I will put in a feature request for this. The next best solution would be to just hide your price markers and then use OnRender to draw just to the left of the scale.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      57 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      20 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      9 views
      0 likes
      Last Post cre8able  
      Working...
      X