How to close all active trades on the last trading day?
Author: GZTRADE
Creation Date: 1/31/2017 7:53 PM
profile picture

GZTRADE

#1
How to make my code close all active trades on the last trading day on a daily chart for backtesting. I'm too new to this can't figure out how to make it work yet. There were a couple other similar threads but it seemed to me they were about intraday charts which got me really confused.

profile picture

Eugene

#2
CODE:
Please log in to see this code.
profile picture

LenMoz

#3
Maybe this (inside the normal trading loop)...
CODE:
Please log in to see this code.
I used "- 2" thinking GZTRADE wanted all trades closed out at the end of the backtest
profile picture

GZTRADE

#4
Thanks a lot got it working perfectly