I would like to do what i think is a pretty simple back test.
Stock XYZ, bought on some date, traded with a 1% trailing stop loss.
Does anyone have an example of such code. Thanks and sorry for such a newbie question.
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Thanks for the response.
Some questions:
1. Where do i define the Bars. Do i need to provide them somehow?
2. Where do i define the Stock i want to test, and the date i want to buy at?
Size:
Color:
First you need to download some historical data for the symbol, as you call it, XYZ. Then you need to read the WL User Guide to find out how strategies are executed.
QUOTE:
and the date i want to buy at?
Since "some date" is too vague, code above just enters randomly and exits with a 1% trailing stop. (Keep in mind that one such exit is never enough as some positions will hang indefinitely.)
If you need to use a specific date to buy, then ignore what's above and use this as a starting point:
CODE:
Please log in to see this code.
Size:
Color: