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-24-2011, 07:29 AM   #1
chakriare
Junior Member
 
Join Date: Jan 2010
Posts: 15
Thanks: 0
Thanked 1 time in 1 post
Default Buy at the close of Range bar

Hi

I'm trying to develop an ninja strategy where it buys at the close of up range bar. i will manually ensure other conditions are met but when i do decide to buy i want to let the system buy it at close of range bar(the reseason i want to automate the buy order is by the time i manually calculate the close price of range bar and place the order, the price is already moved to next range bar.)

i wrote a condition Close(0)>open(0) then go long limit at close with profit target of 10. once i activate this strategy the system is giong back in time and making sure last trade(which would have taken at last up bar) has met the profit target, if not then its not taking any trading at the present. i dont want this to happen, i just want it to look at only from current bar and disregard previous bars or trades.

Please help.

THanks
Chak.
chakriare is offline  
Reply With Quote
Old 06-24-2011, 07:34 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Chak, thanks for the post here - you can put if (Historical) return at your OnBarUpdate() start for the strategy. It would then only evaluate any conditions from the point of enabled / seeing realtime data onwards.

http://www.ninjatrader.com/support/h...sub=Historical
NinjaTrader_Bertrand 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
Buy/Sell this bar at close? dowhk General Programming 9 02-22-2012 07:16 AM
Buy on Close (Today) Stephan123 General Programming 19 03-28-2011 01:41 PM
Predict RSI value on the range bar close nandu Indicator Development 1 01-20-2010 04:31 AM
Close[1] acts on wrong range bar Operandi Strategy Development 11 01-23-2009 07:10 AM
buy/sell at close of bar? coffee898 Charting 4 03-20-2007 03:55 AM


All times are GMT -6. The time now is 02:13 AM.