Hi Everyone!
I am new to WL and was looking to implement and back-test a very simple strategy.
My intentions are as follows:
If stock "A" closes at $50 a share and then opens the next day at $51 a difference of 2% or more, then you would trigger a buy at market open that day. At the end of the trading day you would sell at market close.
I would also like to put in a stop loss for a single day at 10% if possible
I would like to do the opposite thing if the stock drops 2% from close to open, then short it that morning etc, exactly inverse of the long strategy above.
I have been trying to get this to work using the "overnight price change of a previous day" condition but I can't tell if its working or not? Any help would be much appreciated!!
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
I ran the code Eugene, and it's taking trades that it shouldn't.
Here's my take on it. It includes a parameter that you can use to "trade live". For details, strike F11 for the QuickRef and look up
GetSessionOpen.
CODE:
Please log in to see this code.
Size:
Color:
Thanks Guys, I will try it out!
Size:
Color: