NexusFi: Find Your Edge


Home Menu

 





divide 2 indicator values


Discussion in NinjaTrader

Updated
    1. trending_up 2,060 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
oagento
Österreich
 
Posts: 1 since Sep 2012
Thanks Given: 0
Thanks Received: 0

Hello!

Is there anyone who can help with a strategy that should

divide 2 indicator values of 2 different minute periods and go long or short whether the value is below or above zero!?

like this:

if indicator 1 (1MIN) / indicator 2 (5MIN) < 0
go long

and

if indicator 1 (1MIN) / indicator 2 (5MIN) > 0
go short

THANK YOU in advance for any suggestions!

Bernhard


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
[WTS] ATAS Lifetime ULTRA license – EU buyers only – …
Platforms and Indicators
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
No book, only a stair: journaling fills where price move …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
 
  #2 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,972 since Jun 2009
Thanks Given: 534
Thanks Received: 3,720


oagento View Post
Hello!

Is there anyone who can help with a strategy that should

divide 2 indicator values of 2 different minute periods and go long or short whether the value is below or above zero!?

like this:

if indicator 1 (1MIN) / indicator 2 (5MIN) < 0
go long

and

if indicator 1 (1MIN) / indicator 2 (5MIN) > 0
go short

THANK YOU in advance for any suggestions!

Bernhard

The actual quotient doesn't matter, if one number is negative then the quotient will be negative (< 0). Otherwise, it will always be > 0

Back to the actual question, let's say the indicators are a MACD. Assuming the primary data series is a 5min chart

 
Code
// class-level variables
private MACD macd2;   // MACD on the 5-min
private MACD macd1;   // MACD on the 1-min
Then in OnInitialize()

 
Code
Add("SOMESYMBOL", PeriodType.Minute, 1);

macd2 = MACD(Closes[0], 12,9,26);   
macd1 = MACD(Closes[1], 12,9,26);
Then in OnBarUpdate()

 
Code
if (macd1[0] / macd2[0] < 0)
   EnterLong();
else if (macd1[0] / macd2[0] > 0)
   EnterShort();
Something like that (I didn't test this in Ninjatrader).


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on October 30, 2013


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts