NexusFi: Find Your Edge


Home Menu

 





Trouble with multiple data streams


Discussion in TradeStation

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




 
Search this Thread
  #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?
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
MyForexFunds Begins Returning Frozen Funds After CFTC Ca …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

bakaroni,

welcome to NexusFi.

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 NexusFi 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 X 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 NexusFi.

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 NexusFi 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


© 2026 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 - Downloads - Top
no new posts