![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
Does Position.MarketPosition return what the strategy thinks the position is or does it read the position from the TWS?
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Strategy Position. Please see the following Tip - http://www.ninjatrader-support.com/v...ead.php?t=4033
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2007
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |