New to TradeStation/easylanguage -- getting bad data back - futures io
futures io futures trading



New to TradeStation/easylanguage -- getting bad data back


Discussion in EasyLanguage Programming

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

New to TradeStation/easylanguage -- getting bad data back

(login for full post details)
  #1 (permalink)
Knoxville
 
 
Posts: 3 since Jul 2019
Thanks: 0 given, 0 received

Hello,

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:

 
Code
Inputs: Length( 20 );
Variables: CLog(0), SDev(0), StdValue(0), Diff(0);

Value1 = Length;
Value2 = Close[0];
Value3 = Close[1];
Value4 = (Value2 - Value3);
Value5 = Close[2];
Value6 = SquareRoot(Value1 / (Value1 - 1));

// close1 / close2
Value7 = (Value3 / Value5)

Reply With Quote

Can you help answer these questions
from other members on futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
ZigZag with Depth and Backstep
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


MrRobot,

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.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
Knoxville
 
 
Posts: 3 since Jul 2019
Thanks: 0 given, 0 received


ABCTG View Post
MrRobot,

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.

Regards,

ABCTG

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].

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

MrRobot,

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.

 
Code
Inputs: Length( 20 );
Variables: CLog(0), SDev(0), StdValue(0), Diff(0);

Value1 = Length;
Value2 = Close[0];
Value3 = Close[1];
Value4 = (Value2 - Value3);
Value5 = Close[2];
Value6 = SquareRoot(Value1 / (Value1 - 1));

// close1 / close2
Value7 = (Value3 / Value5)
Regards,

ABCTG


MrRobot View Post
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].


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > New to TradeStation/easylanguage -- getting bad data back


Last Updated on July 15, 2019


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts