I'd like to have it notice a red , red, then green bar, where the green bar will be greater then the last red bar.
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
Can someone help me create a simple candle stick patter indicator?
Collapse
X
-
Can someone help me create a simple candle stick patter indicator?
I have it done in think or swim, but I don't know how to make one through ninja trader if someone can help.
I'd like to have it notice a red , red, then green bar, where the green bar will be greater then the last red bar.Last edited by papayax999; 06-30-2020, 12:04 PM.Tags: None
-
Hello papayax999,
Thank you for your note.
Since bar colors are determined by whether the close is higher or lower than the open of the bar, this would be very simple to do in an indicator. I've put together a quick example of how this could be accomplished in an indicator that you can then modify as you wish. This indicator will simply print a dot over any up bar (green) that is preceeded by two down bars (red).
Please let us know if we may be of further assistance to you.Attached FilesKate W.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Kate View PostHello papayax999,
Thank you for your note.
Since bar colors are determined by whether the close is higher or lower than the open of the bar, this would be very simple to do in an indicator. I've put together a quick example of how this could be accomplished in an indicator that you can then modify as you wish. This indicator will simply print a dot over any up bar (green) that is preceeded by two down bars (red).
Please let us know if we may be of further assistance to you.
I attached a word with a photo for an example.Attached FilesLast edited by papayax999; 06-30-2020, 08:48 PM.
Comment
-
Hello papayax999,
Thank you for your note.
To clarify, you're looking to enter one tick above the high of the green bar? You could certainly use the basic logic from the example indicator and put your entry logic inside that. Limit orders will be cancelled if they are not filled and the conditions for entry are no longer true, so it would be cancelled on the next bar if it hadn't filled and the original conditions aren't true anymore.
So, you could do something like this in the OnBarUpdate in a strategy (I used a long limit since in the original indicator you enter if the last 2 bars were down bars and then there's an up bar:
Code:protected override void OnBarUpdate() { // check to make sure we have enough bars on the chart to check, if not, don't process if (CurrentBar < 3) return; // if the open is greater than the close of the preceding two bars and the open is less than the close of the current bar if (Open[2] > Close[2] && Open[1] > Close[1] && Open[0] < Close[0]) { //this will draw a dot above the green up bar. Draw.Dot(this, "Dot "+CurrentBar, true, 0, High[0] + (2*TickSize), Brushes.Goldenrod); //this will place a limit order 1 tick above the high of the current bar EnterLongLimit(High[0] + (1 * TickSize)); } }
Here's a link to our publicly available YouTube channel that goes over using the Strategy Builder to create simple strategies:
Strategy Builder 301
Also, here is a set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.
Condition Builder
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Kate View PostHello papayax999,
Thank you for your note.
To clarify, you're looking to enter one tick above the high of the green bar? You could certainly use the basic logic from the example indicator and put your entry logic inside that. Limit orders will be cancelled if they are not filled and the conditions for entry are no longer true, so it would be cancelled on the next bar if it hadn't filled and the original conditions aren't true anymore.
So, you could do something like this in the OnBarUpdate in a strategy (I used a long limit since in the original indicator you enter if the last 2 bars were down bars and then there's an up bar:
Code:protected override void OnBarUpdate() { // check to make sure we have enough bars on the chart to check, if not, don't process if (CurrentBar < 3) return; // if the open is greater than the close of the preceding two bars and the open is less than the close of the current bar if (Open[2] > Close[2] && Open[1] > Close[1] && Open[0] < Close[0]) { //this will draw a dot above the green up bar. Draw.Dot(this, "Dot "+CurrentBar, true, 0, High[0] + (2*TickSize), Brushes.Goldenrod); //this will place a limit order 1 tick above the high of the current bar EnterLongLimit(High[0] + (1 * TickSize)); } }
Here's a link to our publicly available YouTube channel that goes over using the Strategy Builder to create simple strategies:
Strategy Builder 301
Also, here is a set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.
Condition Builder
Please let us know if we may be of further assistance to you.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jordanq2, Today, 03:10 PM
|
1 response
6 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
2 responses
8 views
0 likes
|
Last Post Today, 03:12 PM | ||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
46 views
0 likes
|
Last Post Today, 02:36 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
6 views
0 likes
|
Last Post Today, 02:12 PM |
Comment