I create Strategies from Rules available which often shows trades being open over night, however, I close all trades at the end of the day and do not want my Performance to show effect of overnight trades when I do back testing. How do I get Strategy to close trades at the end of the day?
Size:
Color:
Size:
Color:
I have implemented the code version of this and I am running my strategy using a paper trading account.
It did not trigger an auto trade for the sell today.
If I look at the trades in the strategy though - it did sell at 4pm.
Is this method for sell at close only good for backtesting or can it be implemented for auto-trading also?
Size:
Color:
If you reread the Wiki article you will see the problem with ExitAtClose (that you've seemingly implemented) outlined there. A proposed solution can also be found there in "Code" section. Note that it requires intraday data to execute your strategy.
For EOD strategies, a possible workaround is exemplified in the WealthScript Programming Guide > Programming Trading Strategies > Alerts > How to: Alert for AtClose Signals.
Size:
Color: