[SIZE=2][FONT=Courier New][COLOR=#0000ff]if[/COLOR][/FONT][/SIZE]
[FONT=Courier New][SIZE=2](Position.MarketPosition == MarketPosition.Long)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]DrawHorizontalLine([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"long stop"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ,Position.AvgPrice - (stop_ticks* TickSize),Color.Pink,DashStyle.Dot,[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]DrawHorizontalLine([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"long tp"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ,Position.AvgPrice + (tp_ticks * TickSize),Color.PaleGreen,DashStyle.Dot,[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]} [/FONT][/SIZE]
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Target Profit/Stoploss Horizontal Lines
Collapse
X
-
Target Profit/Stoploss Horizontal Lines
is there a code to have lines set to adjust Target Profit/Stoploss orders like "Chart trader"? Not looking for all the details that Chart trader plots...but would be nice
Code:Tags: None
-
Bertrand,
I'd be interested in best way to go about visualizing my stops (stop & profit stop). I was thinking of writing an indicator that accepts data series as inputs. And then use Add() within Strategy.Initialize() to add this indicator to the strategy, and pass it some data series that would represent the stop values over time (sometimes it would be null when not in a trade). The strategy would then update the underlying DataSeries objects it passed into the indicator via OnBarUpdate, etc. as the trade position state changed.
Would this be the best way to go about solving this? Or do you have a sample that illustrates a way to achieve this visualization of values modified within a strategy?
Thanks,
JD
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
612 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
355 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
561 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
564 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment