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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment