NexusFi: Find Your Edge


Home Menu

 





trouble adding new time series for different futures contract


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one jordis with 5 posts (1 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 ratfink with 1 posts (0 thanks)
    4. looks_4 Tasker_182 with 1 posts (0 thanks)
    1. trending_up 1,427 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

trouble adding new time series for different futures contract

  #1 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

I am having difficulty adding a time series for the YM contract to my strategy running on ES.

So:
- Strategy is running on ES 12-13
- I want to add the YM 12-13 contract in order to make a few references
- Found in NT7 manual where it looks like I should just have to type the following:
 
Code
Add("YM 12-13", PeriodType.Day, 1);
However, this doesn't work when I try to reference this later in the strategy via:

 
Code
ATR(BarsArray[1], 14)[0] < 200
- If I remove the BarsArray reference, and instead check the ATR for the main instrument (ES), the strategy will execute trades. However, if I do it the above way and try to reference the YM contract no trades are ever executed.



Can anyone help enlighten me as to why I can't seem to reference the YM contract within my code running on ES? Any suggestions are welcome. I'm sort of lost on this one...



Thanks in advance,
jordis







edit: might it have something to do with referencing the 12-13 contract and not the continuous contract? Is it possible to reference the continuous contract?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
32 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #3 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,401



jordis View Post
I am having difficulty adding a time series for the YM contract to my strategy running on ES.

So:
- Strategy is running on ES 12-13
- I want to add the YM 12-13 contract in order to make a few references
- Found in NT7 manual where it looks like I should just have to type the following:
 
Code
Add("YM 12-13", PeriodType.Day, 1);
However, this doesn't work when I try to reference this later in the strategy via:

 
Code
ATR(BarsArray[1], 14)[0] < 200
- If I remove the BarsArray reference, and instead check the ATR for the main instrument (ES), the strategy will execute trades. However, if I do it the above way and try to reference the YM contract no trades are ever executed.



Can anyone help enlighten me as to why I can't seem to reference the YM contract within my code running on ES? Any suggestions are welcome. I'm sort of lost on this one...



Thanks in advance,
jordis







edit: might it have something to do with referencing the 12-13 contract and not the continuous contract? Is it possible to reference the continuous contract?



I am taking a guess here but I think your problem lies with:
 
Code
ATR(BarsArray[1], 14)[0] < 200
try
 
Code
ATR(BarsArray[1], 14)Closes[0] < 200

Be yourself; everyone else is already taken. Oscar Wilde
Reply With Quote
  #4 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

I tried

 
Code
ATR(BarsArray[1], 14)Closes[0] < 200
but ninja wont let that compile. I get a long list of errors. Is there a different way that needs to be typed possibly?

Started this thread Reply With Quote
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

@jordis, your original code looks ok, is the strategy running in an ES Day chart as well?, otherwise there may not be enough data for YM loaded if you're in (e.g.) a 5min ES chart, (increase bars/days for the chart if so). Also is the 'less than 200' test what you want? I assume you change the numbers when you run it against the ES series?

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

Is there maybe a way to make a custom indicator that would only look at YM instead of ES? maybe then I could just plot that indicator and use it in the strategy instead of trying to directly reference the YM series.


still open for suggestions.



Also, I tried

 
Code
ATR(Closes[1], 14)[0] < 200

and had no luck either.



thanks again,
jordis

Started this thread Reply With Quote
  #7 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3


ratfink View Post
@jordis, your original code looks ok, is the strategy running in an ES Day chart as well?, otherwise there may not be enough data for YM loaded if you're in (e.g.) a 5min ES chart, (increase bars/days for the chart if so). Also is the 'less than 200' test what you want? I assume you change the numbers when you run it against the ES series?


ill try these things and see.


basically the 200 is arbitrary. but I have an active strategy running fully automated on YM that is currently quite profitable, and I just want to run the same basic strategy on ES to see if it works there as well. however, the atr filter i use for YM cannot be easily converted over for ES, so I just wanted to "not trade" based on my YM filter, instead of trying to re-write that filter based off of ES numbers.


sounds convoluted I know, it's just frustrating me that I can't get this little test to run.


Thanks,
jordis

Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

still no luck.

i went ahead and got it to work about 80% just by taking this part out, but i would still like to figure out this reference issue


does anyone have any ideas for how criteria completely based on one instrument could execute trades inside another instrument? ie. signals are 100% generated from YM, but executed on ES? That's sort of what I thought I could do here, but I've failed miserably.

thanks again,
jordis

Started this thread Reply With Quote




Last Updated on November 21, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts