BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lakshmiG
Obsidian | Level 7

Dear Friends,

 

I need to populate next day open price to the current day Buy Price. Is that possible? How will i consider future price value to current day. Please clarify.

Thanks!!!

1 ACCEPTED SOLUTION

Accepted Solutions
lakshmiG
Obsidian | Level 7

Thanks much Reeza for your swift response and support.

Found a solution from below link,

http://www.lexjansen.com/nesug/nesug13/113_Final_Paper.pdf

 

data want;
set have;
by symbol;
where symbol="000001.SZ";
if eof1=0 then set have (firstobs=2 keep= open rename=(open=LEAD1)) end=eof1;  
if last.symbol then lead1=.;
run;

And the logic is working.

Thanks!!!

View solution in original post

3 REPLIES 3
Reeza
Super User

Any things possible given enough time, money and resources. 

 

For your problem you need to provide more information. 

Maybe lag or retain will work, but without details those are just guesses. 

 

http://stackoverflow.com/help/how-to-ask

 

http://stackoverflow.com/help/mcve

lakshmiG
Obsidian | Level 7

Thanks Reeza.

I will add more details...

 

In the attached file, Buy/Sell signal are generated. If there is a Buy, then Buy price should be populated which is the open price of next day. Open price is the "open" column in the file.

So, how to populate next day open price adjacent to the Signal Buy?

 

Thanks!!!

lakshmiG
Obsidian | Level 7

Thanks much Reeza for your swift response and support.

Found a solution from below link,

http://www.lexjansen.com/nesug/nesug13/113_Final_Paper.pdf

 

data want;
set have;
by symbol;
where symbol="000001.SZ";
if eof1=0 then set have (firstobs=2 keep= open rename=(open=LEAD1)) end=eof1;  
if last.symbol then lead1=.;
run;

And the logic is working.

Thanks!!!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 798 views
  • 1 like
  • 2 in conversation