NexusFi: Find Your Edge


Home Menu

 





Using currentHigh/Low Open


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
jtradr
Connecticut
 
Posts: 26 since Dec 2010
Thanks Given: 16
Thanks Received: 27

I am looking to use the current day High Low and Open in a strategy.

What is the easiest way to get NT to recognize CurrentHigh in my trade executions.

For example I have a custom line indicator where I want to look for a crossbelow but only if the close of 1 bar ago was above this indicator and a certain number of ticks from the current high. Therefore I need to use CurrentHigh -10*TickSize and I get an error saying that the name CurrentHigh does not exist in the current context. I have a line: Add(CurrentDayOHL());
trying to call on that indicator but it doesn't work.

Thank you in advance.

J


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
SEC Chairman Calls for New Golden Age of SEC-CFTC Regula …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
CME Raises Energy Futures Margins After Iran-War Volatil …
Commodities
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 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


Going solely based on memory, typing free hand, not tested...

 
Code
                            
# vars

private double dayHighdayLow;

# onbarupdate
dayHigh CurrentDayOHLC().CurrentHigh[0];
dayLow CurrentDayOHLC().CurrentLow[0]; 
I don't know about NT7 but I never really liked using CurrentDayOHLC with NT 6.5, I always kept track of the session high/low myself and reset it on a new session.

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)
jtradr
Connecticut
 
Posts: 26 since Dec 2010
Thanks Given: 16
Thanks Received: 27

I am having a problem where my strategy enters the first position of the day and then ignores all profit target and stop loss. Is this because I have my:

private void go long()
{
SetStopLoss("target1").........

SetProfitTarget

EnterLong
}

lines inside the Initialize() portion of the code? I tried to move it to the OnBarUpdate() section and it comes back with a lot of Expected class, delegate, enum, interface, or struct errors so I am assuming there is something that OnBarUpDate doesn't like in there.

The full code is attached.

Thank you in advance.


Attached Files
Elite Membership required to download: BigMikeHelp3.txt
Reply With Quote




Last Updated on January 14, 2011


© 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