How to run the strategy and save result into a file?
Author: Lephan
Creation Date: 2/1/2016 8:44 AM
profile picture

Lephan

#1
Hi,

I am new to wealth-lab. I've been trying to find a way to save data at end of day but I couldn't. Every end of day, I want my script to run through a list of predefined stocks and save the result to a file. So I can look at later on. what would be the best way to do this?
profile picture

Eugene

#2
Hi Huy,

Sure you can do it. For a code example take a look in the QuickRef > AlertDate or StrategyName.

P.S. Depending on what you need to export you might find these routines from Community Components useful:

SaveTrades
Export2ASCII
profile picture

Lephan

#3
Thank you, I will look into this.
profile picture

Lephan

#4
Hi,

I am looking at the code My thought is that this can only run on a stock at a time. is there a way i can run on a list of stocks? that way i don't run it one at a time.
profile picture

Eugene

#5
Everything is possible. You can modify the code to suit your needs e.g. run in a Multi-Symbol Backtest and export the results to individual files. It's up to you.
profile picture

Lephan

#6
Hi Eugene,

thank you for your quick reply. I've been reading about these script a lot. there is one think I am not clear on. these functions BuyAtClose , SellAtClose ..... does these function actual buy/sell a position or just an alert.

What I want to do is some how write a script that run through all the symbols when the market close, if these symbols match some of my strategies then I mark them, I want to review them before I buy/sell them. I would prefer do this in Wealth Lab if it allow me to save these as an alert, if not I will save it to a database and review them before I buy.

I do have lots of background in C# programming and scripting programming like this.

Thanks
profile picture

Eugene

#7
QUOTE:
BuyAtClose , SellAtClose ..... does these function actual buy/sell a position or just an alert.

*AtClose are trading functions. If used with (bar) they do not issue an alert. To find out more on them just open the QuickRef (F11 key).