![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
i have a strategy which i launch from the chart..it currently process instruments which i imported over(20 symbols)..if the chart is loaded on an instrument, will the strategy process all the 20 symbols? or does a chart have to be open for each instrument for the strategy to work? I have a strategy with 20 symbols on a daily chart of BAC...one of the symbols is XLI, which i imported over. But when i try to bring up XLI on another chart, it is blank. would it be better to run the strategy from the TAB and not from the CHART? using multiple symbols?
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
mystiq, already replied in your other thread on the topic - if you created a multiinstrument strategy and added your 20 symbols in it's code to be loaded, it would maintain the data needed if you just start it on your primary chart -
http://www.ninjatrader-support.com/H...struments.html Please note that those symbols will then not appear on a chart automatically with this procedure, they are just available 'in the back' to run calculations on.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
Quote:
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
You're welcome, sounds good - I could not comment on how much your strategy would need historical data wise to initialize properly as needed, so normally you want to load more days than 1 - please note that the MinBarsRequired is not how many days are loaded - this will be set as you create the chart (daysToLoad).
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
Quote:
...if i am running a multi-instrument strategy that alerts on a 30min BAC chart,...which has 20 instruments already coded in strategy, and one instrument is IBM, would the strategy alert me to IBM if conditions are met? or do i have to open another 30min chart just for each instrument?
|
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
You would not have to open a chart for each instrument - however the conditions for the alert have to be coded to use the IBM price series -
http://www.ninjatrader-support.com/H...struments.html You can see example code how to start under the 'True Event Driven OnBarUpdate() Method' section.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
Quote:
please explain to a newbie....![]() edit: the extra instruments are not HARD CODED within strategy, but manually added as a parameter (?soft coded?) will your explaination still apply?
Last edited by mystiq; 07-08-2010 at 03:42 AM.
Reason: add info
|
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
mystiq, the symobls you want to use in your strategy are added with the Add() command in the Initialize(), you can then either access them in the right BarsInProgress context (check with of your bars objects is calling the OnBarUpdate to do calculations) or you can access this instruments data via the BarsArray property, so you can decide which input series your indicator / calculations should use, for example consider an SMA(BarsArray[1], 20) would give you the 20 Period SMA on the first added / the secondary instrument in your strategy.
If you take some time and review our SampleMultiInstrument strategy installed per default with NinjaTrader it should become clearer and clearer how this environment is designed.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Initiating ATM Strategies in a NinjaScript | daven | Automated Trading | 7 | 08-18-2010 10:47 PM |
| Initiating trade from within Indicator | seanhughes16 | Automated Trading | 2 | 04-07-2010 11:32 PM |
| Error initiating strategy | POINTERDOG | ATM Strategies (Discretionary Trading) | 3 | 08-14-2009 09:48 PM |
| Delay initiating exit-on-close order on IB | tooearly | Automated Trading | 2 | 07-30-2009 08:26 AM |