NexusFi: Find Your Edge


Home Menu

 





NinjaTrader strategy. how to reference lowest low


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 2 posts (1 thanks)
    2. looks_two fiki with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 phyzfer with 1 posts (0 thanks)
    1. trending_up 4,478 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
fiki's Avatar
 fiki 
sweden
 
Experience: Intermediate
Platform: TOS, NT
Trading: ES
Posts: 212 since Jun 2009
Thanks Given: 61
Thanks Received: 433

when writing a strategy. how do i make a condition that low is the lowest of the day (or x periods)?


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
February NFP Preview -- Why This Mornings Jobs Number Co …
Traders Hideout
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557



fiki View Post
when writing a strategy. how do i make a condition that low is the lowest of the day (or x periods)?

If you are using intraday time sizes (ie: 6 range, 5m, anything not 1 day) then the easiest way is to just track it yourself bar by bar.

You need to then reset it each day.

Something like:

 
Code
                            
#var

double dayhigh;
double daylow;

#onbarupdate
if (Bars.SessionBreak)
{
dayhigh 0;
daylow 0;
}

if (
High[0] > dayhighdayhigh High[0];
if (
Low[0] < daylow || daylow 0daylow Low[0]; 
Now the day low and day high are available in the daylow and dayhigh variables.

Mike




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 X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557

I had a small error which I corrected now. daylow would never be less than 0, so now we check to see if it is zero.

 
Code
                            
if (Low[0] < daylow || daylow 0daylow Low[0]; 

Mike




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 X Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 
fiki's Avatar
 fiki 
sweden
 
Experience: Intermediate
Platform: TOS, NT
Trading: ES
Posts: 212 since Jun 2009
Thanks Given: 61
Thanks Received: 433

thanx. i managed to get it to work.


Started this thread Reply With Quote
  #6 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33

This might be helpful too:

CurrentDayOHL().CurrentLow[0];

The value inside the [ ] is the barsAgo value.


Reply With Quote




Last Updated on March 28, 2010


© 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