NexusFi: Find Your Edge


Home Menu

 





divide 2 indicator values


Discussion in NinjaTrader

Updated
    1. trending_up 1,960 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?
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Thanks Mike. Godspeed.
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
  #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