Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
NinjaTrader strategy. how to reference lowest low
Updated March 29, 2010
Top Posters
looks_one
Big Mike
with 2 posts (1 thanks)
looks_two
fiki
with 2 posts (0 thanks)
looks_3
Quick Summary
with 1 posts (0 thanks)
looks_4
phyzfer
with 1 posts (0 thanks)
trending_up
3,714 views
thumb_up
1 thanks given
group
2 followers
forum
5 posts
attach_file
0 attachments
NinjaTrader strategy. how to reference lowest low
March 26th, 2010, 03:58 PM
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)?
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
March 26th, 2010, 04:59 PM
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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665
fiki
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 ] > dayhigh ) dayhigh = High [ 0 ]; if ( Low [ 0 ] < daylow || daylow = 0 ) daylow = Low [ 0 ];
Now the day low and day high are available in the daylow and dayhigh variables.
Mike
March 26th, 2010, 07:31 PM
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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665
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 = 0 ) daylow = Low [ 0 ];
Mike
March 27th, 2010, 02:25 AM
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.
March 28th, 2010, 11:15 PM
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.
Last Updated on March 28, 2010