Modify ASCII extraction script to only grab data after a certain date?
Author: DRudel
Creation Date: 3/18/2016 9:44 PM
profile picture

DRudel

#1
Hello,
The script here worked fantastic for exporting my data into ASCII.

My goal now is to modify the script so that it only exports data after a certain date, or just data from the last N days. Could someone help me with that?

Thanks!
profile picture

Eugene

#2
Hello David,

Welcome to the forums.

QUOTE:
only exports data after a certain date

1. Inside the loop by Bars and just prior to adding a CSV string to "datalist" (i.e. before line 37), insert this condition:
CODE:
Please log in to see this code.

See sources from the Wiki FAQ on how to define a DateTime in .NET.


QUOTE:
or just data from the last N days

2. Modify the loop accordingly (where 200 is your N-days lookback):
CODE:
Please log in to see this code.
profile picture

DRudel

#3
Thanks, Eugene.

I must shame-facedly admit that I am very new to WLP and did not realize that the script only acted on the data specified in the data panel, so that helps a lot. In addition to modifying the script, I also noticed that I can just change the date range there to get the data I want.
profile picture

Eugene

#4
QUOTE:
I also noticed that I can just change the date range there to get the data I want.

Absolutely :)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).