NexusFi: Find Your Edge


Home Menu

 





what does this code mean?


Discussion in NinjaTrader

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




 
Search this Thread

what does this code mean?

  #1 (permalink)
 
ticker's Avatar
 ticker 
Houston TX
 
Experience: Advanced
Platform: NinjaTrader
Trading: TF
Posts: 49 since Oct 2010
Thanks Given: 63
Thanks Received: 9

Fellow traders,

I understand basic coding, however, this one has me stumped, as I cant figure out the logic of what it is saying. Would appreciate a plain English translation if anyone knows.

private int period = 5
dataseries.set = (MAX(High, period)[0] - MIN(Low, period)[0])

starting from the inside out...

1st (high of the last 5 periods) - (minimum of the last 5 periods)
2nd what does MAX mean here? If you subtract two values, isnt that the max already?
What am I missing?


Thanks.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Quantum physics & Trading dynamics
The Elite Circle
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,470 since Jun 2009
Thanks Given: 33,249
Thanks Received: 101,673



ticker View Post
Fellow traders,

I understand basic coding, however, this one has me stumped, as I cant figure out the logic of what it is saying. Would appreciate a plain English translation if anyone knows.

private int period = 5
dataseries.set = (MAX(High, period)[0] - MIN(Low, period)[0])

starting from the inside out...

1st (high of the last 5 periods) - (minimum of the last 5 periods)
2nd what does MAX mean here? If you subtract two values, isnt that the max already?
What am I missing?


Thanks.

In plain english "Set dataseries to the Highest High of the last 5 bars, as of this current bar, minus the Lowest Low of the last 5 bars, as of this current bar"

MAX() means highest value.

MAX(High, period)[0] means MAX High (High as in OHLC, open high low close), period meaning 5 bars, [0] meaning current bar. MAX(High, period)[1] would mean as of 1 bar ago for example. MAX(High) in trading means "Highest High". But you could also do MAX(Open, period)[0] for example to mean highest Open.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on April 11, 2013


© 2024 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 - Privacy Policy - Downloads - Top
no new posts