Yesterday's close - should be simple Right.... - futures io
futures io futures trading



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 Gannastrology with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,340 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 8 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
 

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

(login for full post details)
  #1 (permalink)
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
 
Posts: 11 since Dec 2015
Thanks: 3 given, 0 received

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 futures io?
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
Reading A set of Trading Signals
EasyLanguage Programming
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
104 thanks
Rank your Futures vs Stocks trading priority
54 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Whats this confusion with margins?
23 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


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 Twitter Reply With Quote
 
(login for full post details)
  #4 (permalink)
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
 
Posts: 11 since Dec 2015
Thanks: 3 given, 0 received

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
 
(login for full post details)
  #5 (permalink)
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
 
Posts: 11 since Dec 2015
Thanks: 3 given, 0 received

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
 
(login for full post details)
  #6 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

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 Twitter Reply With Quote
 
(login for full post details)
  #7 (permalink)
Long Beach
 
Experience: None
Platform: tradestation
Trading: ES
 
Posts: 11 since Dec 2015
Thanks: 3 given, 0 received

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
 
(login for full post details)
  #8 (permalink)
Prescott Valley+ Arizona/USA
 
 
Posts: 2 since Feb 2020
Thanks: 1 given, 0 received

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
 
(login for full post details)
  #9 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

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 Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Yesterday's close - should be simple Right....


Last Updated on February 6, 2020


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