NexusFi: Find Your Edge


Home Menu

 





Trouble with multiple data streams


Discussion in TradeStation

Updated
    1. trending_up 2,163 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Trouble with multiple data streams

  #1 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0

My apologies if this is too basic a question, but I'm using 2 data streams (SPY & $VIX.X) on a chart & tried to add a new strategy that I developed. When I do that, it goes into a loop for a while and then the strategy gets turned off. Clearly TS doesn't like something in my strategy code. It's very simple. Here's the relevant portion:

inputs:
lookBack(2);

vars:
vixSlope(0);

vixSlope = TLSlopeEasy(Close Data2, lookBack, 0);
print ("Slope is ", vixSlope);

<then do something>

The print statement does not appear at all, so it appears to be bombing out on the TLSlopeEasy statement. When I run this strategy on a chart with a single symbol and remove Data2 from the code above, it works as expected. What am I doing wrong?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

bakaroni,

welcome to futures.io.

Your code works on my end, but one thing you might want to look into is how to assign variables and functions to a specific datastream. You can even find examples here on futures.io using the search function.

Do you receive an error message? If so, what does it say exactly?

Regards,

ABCTG


bakaroni View Post
My apologies if this is too basic a question, but I'm using 2 data streams (SPY & $VIX.X) on a chart & tried to add a new strategy that I developed. When I do that, it goes into a loop for a while and then the strategy gets turned off. Clearly TS doesn't like something in my strategy code. It's very simple. Here's the relevant portion:

inputs:
lookBack(2);

vars:
vixSlope(0);

vixSlope = TLSlopeEasy(Close Data2, lookBack, 0);
print ("Slope is ", vixSlope);

<then do something>

The print statement does not appear at all, so it appears to be bombing out on the TLSlopeEasy statement. When I run this strategy on a chart with a single symbol and remove Data2 from the code above, it works as expected. What am I doing wrong?


Follow me on Twitter Reply With Quote
  #3 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0



ABCTG View Post
bakaroni,

welcome to futures.io.

Your code works on my end, but one thing you might want to look into is how to assign variables and functions to a specific datastream. You can even find examples here on futures.io using the search function.

Do you receive an error message? If so, what does it say exactly?

Regards,

ABCTG

I don't get an error message. The cursor changes to the circular one (indicating that it's working) and then after a while it disappears and my strategy is automatically turned off. My understanding is that I'm passing the correct datastream to the code, so I'm baffled as to why I see this strange behavior.

Reply With Quote
  #4 (permalink)
bakaroni
San Francisco, CA
 
Posts: 7 since Jan 2022
Thanks Given: 0
Thanks Received: 0

Okay, I've figured out the problem. In my <do something> section of the code I had turned on IntraBarOrderGeneration to true. TS doesn't like that when there are multiple data streams on a chart. Not sure why. I removed that and it works fine.

Reply With Quote




Last Updated on January 27, 2022


© 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