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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
36 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
14 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
22 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment