Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Drawing only appears on the last occurence of the pattern
Collapse
X
-
Hello Pabulon,
Dots and Diamonds do not take an outline brush parameter. They can only be drawn in with one single color, there is no way to specify a different color for the outline with these methods unfortunately.
- Likes 1
-
Wonderful advice, thank You very much.
Is there a way of adding OutlineBrush in this single line:
Code:Draw.Dot(this, "myTag" + CurrentBar, true, 0, Low[0] - TickSize, Brushes.Red);
Leave a comment:
-
Hello Pabulon,
Thank you for your post.
The tag for a drawing object is a unique ID used to reference that specific drawing object. If you reuse the same tag, each time you call a drawing object the same drawing object will be referenced and the existing drawing object will be modified instead of a new object being created.
For example, if you tag your drawing object “myTag”, each time you use “myTag” the same drawing object will be modified.
To create a new drawing object, use a new unique string as the tag each time you call a Draw method. As an easy way to make a new string unique add ‘CurrentBar’ to the string.
Help Guide: NinjaScript > Language Reference > Common > OnBarUpdate() > CurrentBar
The code below will create a new red dot one tick below the low each time it is called.
Code:Draw.Dot(this, "myTag" + CurrentBar, true, 0, Low[0] - TickSize, Brushes.Red);
- Likes 1
Leave a comment:
-
Drawing only appears on the last occurence of the pattern
Hi,
First of all - I have no coding experience. I would like to modify existing indicator so that instead painting bars - it would place a Diamond below or above the bar.
In this indicator I've located a place
case 2:
BarBrushes[1] = _Color;
BarBrushes[0] = _Color;
break;
When I place a phrase: "Draw.Diamond(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Red);", above "break", Diamond actualy appears in correct spot but only on the last spot on the chart where the pattern occured. Meanwhile bars remained Painted for all the duration that is availalbe on the chart.
How to make this Diamond to appear on all occurences on the chart instead of only the last one?
Regards
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Buttony, 01-18-2025, 12:10 PM
|
8 responses
47 views
0 likes
|
Last Post
by rockmanx00
Today, 04:18 PM
|
||
Started by frslvr, 04-11-2024, 07:26 AM
|
19 responses
723 views
1 like
|
Last Post
by Zinovate
Today, 04:08 PM
|
||
Started by johnMoss, Today, 04:00 PM
|
0 responses
4 views
0 likes
|
Last Post
by johnMoss
Today, 04:00 PM
|
||
Started by HappyTrader76, Today, 03:56 PM
|
0 responses
5 views
0 likes
|
Last Post Today, 03:56 PM | ||
Started by mjairg, 07-31-2024, 11:48 AM
|
7 responses
102 views
0 likes
|
Last Post
by Ducman_nl
Today, 03:52 PM
|
Leave a comment: