NexusFi: Find Your Edge


Home Menu

 





Yesterday's close - should be simple Right....


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Chuck6475 with 4 posts (0 thanks)
    2. looks_two ABCTG with 3 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Gannastrology with 1 posts (0 thanks)
    1. trending_up 7,296 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 Chuck6475 
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
Posts: 11 since Dec 2015
Thanks Given: 3
Thanks Received: 0

The more I learn the more I know I don't know.

Okay, any help would be greatly appreciated.

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.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Warsh Rate Hike at 40%, Iran June 15 Expires Tonight at …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


Chuck6475,

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.

Regards,
ABCTG


Follow me on X Reply With Quote
  #4 (permalink)
 Chuck6475 
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
Posts: 11 since Dec 2015
Thanks Given: 3
Thanks Received: 0

Thanks for the reply,

The issue with highlight etc. is now gone. Easy come easy go. Love it.

It also appears that i'm getting different data results. I will need to do some more testing to see what is real and what is not. Color me annoyed.


Started this thread Reply With Quote
  #5 (permalink)
 Chuck6475 
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
Posts: 11 since Dec 2015
Thanks Given: 3
Thanks Received: 0

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.


Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

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.

Regards,

ABCTG


Follow me on X Reply With Quote
  #7 (permalink)
 Chuck6475 
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
Posts: 11 since Dec 2015
Thanks Given: 3
Thanks Received: 0

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?


Started this thread Reply With Quote
  #8 (permalink)
Gannastrology
Prescott Valley+ Arizona/USA
 
Posts: 2 since Feb 2020
Thanks Given: 1
Thanks Received: 0

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?

Thanks for any input


Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

Gannastrology,

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.

Regards,

ABCTG


Gannastrology View Post
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?

Thanks for any input


Follow me on X Reply With Quote




Last Updated on February 6, 2020


© 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