Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Difference of Two Indicators?
Collapse
X
-
Difference of Two Indicators?
HI, has anyone done an indicator to plot the difference of two indicators? What I've seen so far is spread stuff, that takes two instruments, but I want to take the running difference between two indicators, for instance RSI(14) and another indicator of 14 period or something like that. Thanks!Tags: None
-
Hello chinaexpert1a, thanks for your post.
That can be done like this:
Please let me know if I can assist any further.Code:public class TestRSI : Indicator { private SMA _SMA0; private RSI _RSI0; protected override void OnStateChange() { if (State == State.SetDefaults) { //... } else if (State == State.Configure) { } else if(State == State.DataLoaded) { _SMA0 = SMA(14); _RSI0 = RSI(14, 3); } } protected override void OnBarUpdate() { var diff = _SMA0[0] - _RSI0[0]; Print(diff); } }
-
Great! Thank you... so I see you have provided me with code, hehe, I'm....? noooooob
Chris, do I need to make a custom indicator? I do want to, you suggest the 7+Breaking or other route, hire a programmer. :/
lol
Thanks
Andrew
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
55 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
73 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
38 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
99 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
60 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment