NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-17-2008, 10:20 AM   #1
trademark
Junior Member
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Programming an ORB

Hi there,

i´m trying to program Opening Range breakout strategy, which contains the following conditions:

- Trend Indicators on the Daily Chart
- customized Opening Range on a 15 Min Chart

Since i´m right at the start and I need to do some experiments on this topic, i´ll leave this Trend Indicators on Daily for later programming sessions, but i now have a problem on constructing the opening range on a 15 min chart.

i use the predefined CurrentDayOHL indicator for calculating the open of the session and i want to add and subtract certain numbers to/from the open.

However, it is impossible to use"+" and "-" with strings and a bolean or a double, lets say. The only thing, thats possible, is comparing strings.

So I tried for example

if (Close[0]> CurrentDayOHL.CurrentOpen[0]+ATR(periods))

as a condition, but this will give me a compiling errorcode.

How do I overcome this problem??
I´m not a programmer and i also tried it via the wizzard, but it also looks like it isn´t possible

Thanks alot for your help
trademark is offline  
Reply With Quote
Old 06-17-2008, 10:27 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

Try something like:

if (Close[0]> CurrentDayOHL.CurrentOpen[0]+ATR(periods)[0])
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-17-2008, 10:40 AM   #3
trademark
Junior Member
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default



Cool...it worked.
Thanks for the quick reply.
trademark is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming connections Gumphrie Connecting 6 12-11-2009 03:09 AM
Zero Lag MACD - programming hint total3 Indicator Development 28 05-27-2009 08:49 AM
3rd Party Programming John_Aus General Programming 2 05-26-2008 10:51 PM
Programming references bobajob78 General Programming 1 02-11-2008 03:32 PM
Advanced Programming sbtrader General Programming 3 10-26-2007 10:11 AM


All times are GMT -6. The time now is 09:57 AM.