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, 03-31-2026, 09:41 PM
|
1 response
72 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
39 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment