thanks
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!
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
NinjaTrader
Custom Candle Paint Bar
Collapse
X
-
Custom Candle Paint Bar
Hi, I’d like to make a custom paint bar indicator that uses only the body of the candle (no wick), super thin and can be placed either on the left, right, or middle of the bar. Some indicators like for footprint allow you to use what’s called paint bars which do just that. Does anyone know of any indicators like this or can point me in the right direction?
thanksTags: None
-
Hello the_soloist,
Thank you for your post.
Can you clarify, are you trying to change the color of the bar, or draw an object to the left/right/middle of the bar?
BarBrush will allow you to change the color of a price bar's body. CandleOutlineBrush will change the color of the outline of a candlestick.
BarBrush - https://ninjatrader.com/support/help...8/barbrush.htm
CandleOutlineBrush - https://ninjatrader.com/support/help...tlinebrush.htm
Below is a list of all the Drawing methods you can use to draw different objects on the chart.
If you want to draw to the left or the right of the bars, you will need to use custom rendering.
Using SharpDX for Custom Chart Rendering - https://ninjatrader.com/support/help..._rendering.htm
Please let me know if I can assist further.
Gaby V.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Gaby View PostHello the_soloist,
Thank you for your post.
Can you clarify, are you trying to change the color of the bar, or draw an object to the left/right/middle of the bar?
BarBrush will allow you to change the color of a price bar's body. CandleOutlineBrush will change the color of the outline of a candlestick.
BarBrush - https://ninjatrader.com/support/help...8/barbrush.htm
CandleOutlineBrush - https://ninjatrader.com/support/help...tlinebrush.htm
Below is a list of all the Drawing methods you can use to draw different objects on the chart.
If you want to draw to the left or the right of the bars, you will need to use custom rendering.
Using SharpDX for Custom Chart Rendering - https://ninjatrader.com/support/help..._rendering.htm
Please let me know if I can assist further.
1 Photo
Comment
-
Hello,
You can change the bar width by right-clicking within the chart > Data Series > change the 'Bar width' property.
You can also access it programmatically within an indicator using ChartBars.Properties.ChartStyle.BarWidth:
ChartBars - https://ninjatrader.com/support/help.../chartbars.htm
Properties - https://ninjatrader.com/support/help...properties.htm
Please let us know if you have any other questions.Gaby V.NinjaTrader Customer Service
Comment
-
Ok got it. In regards to SharpDX, would you have any suggestions on how to implement it in the code below:
Code:#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; using SharpDX; #endregion //This namespace holds Indicators in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { public class BarBrushTest : Indicator { protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "BarBrushTest"; Calculate = Calculate.OnPriceChange; IsOverlay = true; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = true; } else if (State == State.Configure) { } } protected override void OnBarUpdate() { if (CurrentBar < 10) return; if (Close[0] > Open[0]) BarBrush = Brushes.DodgerBlue; CandleOutlineBrush = Brushes.Transparent; if (Close[0] < Open[0]) BarBrush = Brushes.Red; CandleOutlineBrush = Brushes.Transparent; } } }
Comment
-
Hello,
It depends on what you would like to render using SharpDX. Are you trying to render a line, shapes, text?
Take a look at the 'SampleCustomRender' indicator in the platform which demonstrates using SharpDX. You can look at the code for it in the NinjaScript Editor.
Please let us know if you have any other questions.Gaby V.NinjaTrader Customer Service
Comment
-
Ok cool thanks for your help. Yeah I’m just trying to simply move the candles to the right side of the bar.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by lightsun47, Today, 03:51 PM
|
0 responses
4 views
0 likes
|
Last Post
by lightsun47
Today, 03:51 PM
|
||
Started by 00nevest, Today, 02:27 PM
|
1 response
8 views
0 likes
|
Last Post
by 00nevest
Today, 03:48 PM
|
||
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
44 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
1 response
13 views
0 likes
|
Last Post
by bltdavid
Today, 02:44 PM
|
||
Started by port119, Today, 02:43 PM
|
0 responses
9 views
0 likes
|
Last Post
by port119
Today, 02:43 PM
|
Comment