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)
1. Why can't I use my mouse and highlight easy language code in TradesStation so I can Copy it. (is it just me?)
2. I'm trying to get Yesterday's closing price for stocks. I've tried...
Value4 = close of yesterday of data(n);
Compiles fine but doesn't give the correct number
Value4 = CloseD(1) of data(n);
This gives a warning "A series function should not be called more than once with a given set of parameters" - Whatever that means. Runs but also doesn't give the correct number.
Help, it doesn't seem like this should be that hard. What am I missing?
Thanks.
Can you help answer these questions from other members on NexusFi?
1. Works fine here, so I guess "it is just you". Highlighting the code and right clicking gives a bunch of options, where "copy" is one of them.
2. What chart timeframe are you using? On a daily chart it can be as simple as Close[1]. CloseD(1) should work as well. You can also track the close yourself and store this value in a separate variable on a date change.
The best option depends on the timeframe, though.
Okay, after stepping my routine through it's paces it appears the value for close of yesterday is weird.
If you use the Net Chg indicator of the Label line or Radar Screen you get the following definition:
Market Synopsis
The difference between current price and the previous day's closing price, expressed in points. By default, the value is displayed in UpColor when the value is positive and in DnColor when the value is negative. Net Chg is based on the Last value, so it continues updating if market activity continues after the regular session closes. This is a grid-based indicator.
Plot Information
Number Name Default Color Description
Plot1 Net Chg White Net change price difference
Interestingly, I can't get it to duplicate via Easy Language.
You would think if you took { Close of yesterday of data(n) - close } You would get the same net chg number but you don't.
It appears the issue is what is { Close of yesterday's value and from where } I can't seem to get it to match up with anything.
If you follow what I wrote under point 2. in my first reply you should have no problems getting it to work.
The reserved word "yesterday" is is retained for backward compatibility.
Remarks
Yesterday references the previous bar, even when analyzing intraday bars.
Yesterday is no longer necessary as the following are equivalent:
Value1 = Close of Yesterday;
Value1 = Close of 1 Bar Ago;
Value1 = Close[1];
So the issues could come from using yesterday on intraday charts and expecting to actual get values from yesterday (which in this case will only happen on the very first bar of the day!) for example.
I really appreciate you taking time to help me understand something I obviously didn't understand.
Here is what I got: [on a 5 minutes chart]
Close { would be the close of the current bar}
Close[1] { would be the close of the prior bar, 5 minutes earlier}
etc.
The question is: Is there a "packaged" way to get the prior day's closing price for a data stream or do I have to write a routine to capture that on the run?
Tradestation: I am using Version 10, and I cant seem to get past getting a value for yesterdays close. I am using a Daily chart on the ESH20 Daily, and trying to plot the line. I am using similar code to this:
Value1 = PrevClose, Also tried Value1=Close of Yesterday, Also tried Value1= CloseD(1)
I read that you get a -1 value as a return when using CloseD(1), so is there a different assignment process to return the value of close versus the True/False Indicator value?
can you post the full code you used and how you checked that a value of -1 was returned?
I don't receive a return of -1 for either of the three when used as input in the Custom 3 Line built-in indicator. However, keep in mind that PrevClose is a quote field that will not return historical values i.e. it will return the same value on all bars.