NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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 12-04-2007, 01:00 PM   #1
maxpi
Senior Member
 
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default Strategy and marketposition

Does Position.MarketPosition return what the strategy thinks the position is or does it read the position from the TWS?
maxpi is offline  
Reply With Quote
Old 12-04-2007, 01:01 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Strategy Position. Please see the following Tip - http://www.ninjatrader-support.com/v...ead.php?t=4033
NinjaTrader_Ray is offline  
Reply With Quote
Old 12-22-2007, 11:19 AM   #3
Xkaern
Junior Member
 
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

A somewhat related question:
I haven't programmed anything in a long time, so I'm refreshing all this while learning C# and NS... so I'm still just testing out on sim accounts at the moment.
If my strategy only enters a trade when MarketPosition is flat, is it possible to for example, open 2 different charts, and have the same strategy run simultaneously on two different time frames of the same market (ie, both 1 and 5 min ES). Or will MarketPosition for the 1 min time frame return Long when a Long is taken on the 5 min time frame and thus not be able to take 2 trades at the same time on different time frames? Or do the strategy positions not overlap being as they are run separately?

On a different note: I want my trade entry to be based only on Bar Close. If the entry is based on an indicator that only updates on Bar Close, is it then possible to run the Script with Update on Bar Close false, so that I can update the stop loss intra-bar, but the entry should still remain only based on bar close due to the indicator's settings that are part of the entry trigger?

Thanks
Xkaern is offline  
Reply With Quote
Old 12-22-2007, 12:34 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Yes you can run strategies on the same market on an infinite number of charts. The strategy positions do not overlap. They are unique for each instance of a running strategy.

Indicators called within a strategy will inherit the CalculateOnBarClose property from the running strategy. Should you wish to run your strategy tick by tick but only take signals on the close of the bar, use the following property.

http://www.ninjatrader-support.com/H...TickOfBar.html

Keep in mind, during a backtest, strategies are only evaluated at the close of a bar.
NinjaTrader_Ray 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
use Positions[0].MarketPosition Folls Strategy Development 2 10-17-2007 06:19 AM
Problem with MarketPosition.Flat zoltran Strategy Development 3 04-10-2007 06:57 AM
Position.MarketPosition Oli Suggestions And Feedback 5 04-03-2007 01:15 AM
multiple charts - one strategy - marketposition funk101 Strategy Development 1 03-30-2007 02:01 AM
MarketPosition.Flat compile error DarrylT Strategy Development 3 01-10-2007 05:49 AM


All times are GMT -6. The time now is 09:21 PM.