I try some code like this:
if (BarsInProgress == 1) {
if (ToTime(Time[0]) >= 215930) {
ExitShort("Short");
}
}
I'm using the daily chart as my primary chart for my entry signals and I'm using a 5 minute chart for the exit. My first step is to exit on close. Once that is working I'd like to put in some logic to determine if I exit on close or hold another day. Since I can't get exit on close working I'm really stuck.
PS: I just realized that there are actually two ways to close at the end of day.. There is the real market on close and there is sending a market order a few seconds before close. For now I'm talking about the latter but I'd also like to know how to send a real MOC order which has to be sent 20 minutes before the close for NYSE stocks..

Comment