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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
35 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
12 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment