Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
changing plot
Collapse
X
-
changing plot
hi i added some lines to the indicator attached below to 1 for long and -1 for short and is working but I'm wondering if there's a way that i can modified the code that i can plot the signal 1 candle prior this is the lines i added (285, 286, 306, 307)
1 PhotoTags: None
-
Hello fgs092790,
For the plot to be set 1 candle before it is now the condition would have to be true 1 bar earlier. While you can set a previous bars plot value for visual purposes that would not be reflected if you are using the value for a signal in another script. If you do want to set a previous plot value you would just use [1] bars ago when setting the plot.
Regarding the code you added, if you plan to use that as a signal for a strategy your public property needs to be defined like the following which uses Update:
Code:private int trade; public int Trade { // We need to call the Update() method to ensure our exposed variable is in up-to-date. get { Update(); return trade; } }
-
Hello fgs092790,
That would depend on how you want the logic to work, I couldn't really provide a specific answer on that. If the indicator is plotting in a specific way now the only way to have its plot happen 1 bar earlier would be to change its logic in a way that you can detect that 1 bar earlier.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
186 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
345 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
267 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment