Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
New to TradeStation/easylanguage -- getting bad data back
I came over to TradeStation from Thinkorswim bc they seemed to have more advanced developer tools. I'm trying to write a stdDev price spike indicator which needs the values of Close[0], Close[1], Close[2].
I'm always getting a "can't divide by zero" error and I finally figured out its bc, according to the debugger, the value of Close[1] and Close[2] are always the same price. Regardless of which ticker I'm using the two values will always be the same -- they'll differ from ticker to ticker, but the two closing prices are always the same.
Also, the price data coming back for Close[x] is completely wrong. Every ticker its off by 5 or 10% in the dev env..
I'm using the simulated trading, and the chart data is correct, its just the dev environment is pulling bad data.
I appreciate any suggestions.
Sample:
Can you help answer these questions from other members on NexusFi?
Tradestation is very sensitive when it comes to divisions and it makes sense to check that the denominator is different than 0 for every division within your code.
Yes, that makes sense. However, the only reason the denominator is 0 is bc its pulling in bad Closing bar data and using the same value for Close[1] and Close[2].
from the code you posted the same value for Close[1] and Close[2] shouldn't be able to result in a denominator of 0. Which makes it likely that the error message you are getting is not caused by Close[1] and Close[2] being equal.