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 3,714 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?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665



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



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:
  #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,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 0daylow Low[0]; 

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