Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to combine 2 indicators
Collapse
X
-
How to combine 2 indicators
My idea for my indicator isn't particularly innovative however it requires me to combine 2 preexisting indicators in a way that just isn't possible through the strategy builder, however I also have very limited coding knowledge and no experience. Is there any advice I can get for how I might be able to maybe copy and paste them together to build this indicator. For more info, the 2 indicators are the MACD and the MFI. -
Hi KDTrade, thanks for posting. You can create indicator objects inside of your script so you do not need to copy/paste the logic. See the "SampleMACrossover" strategy as an example, it can be found in the Strategies folder of the NInjaScript Editor. That strategy adds two SMA objects and the SMA data is used in the Strategie's OnBarUpdate method.
To create an object of MACD and MFI, instead of using the "SMA" type, use the "MACD" and "MFI" types.
Kind regards,
-ChrisL
- Likes 1
-
Hi Chris,
Unfortunately, I'm not sure I fully understand your explanation but I appreciate your quick reply, maybe some more explanation is needed. What I'm trying to do is replace the input for the MACD from price to the MFI, which I can do in the strategy builder. However, I'm trying to replace the individual moving averages in the MACD itself with a moving average of two different MFI's with different periods. Hopefully this explains what I'm trying to do and why I believe I can't use the strategy builder.
King Regards,
KD
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
64 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
93 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
48 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
106 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
63 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment