NexusFi: Find Your Edge


Home Menu

 





NinjaTrader strategy. how to reference lowest low


Discussion in NinjaTrader

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




 
Search this Thread

NinjaTrader strategy. how to reference lowest low

  #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?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 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,399 since Jun 2009
Thanks Given: 33,174
Thanks Received: 101,539



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 Twitter 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,399 since Jun 2009
Thanks Given: 33,174
Thanks Received: 101,539

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 Twitter 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


© 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