SETEXITONCLOSE in auto trading
SETEXITONCLOSE in auto trading
The SETEXITONCLOSE cannot close all the open positions before the market close in auto trading. How to use the SETEXITONCLOSE in Auto Trading?
Re: SETEXITONCLOSE cannot be used in auto trading
You can use time based condition to exit something like:The SETEXITONCLOSE cannot close all the open positions before the market close in auto trading. How to use the SETEXITONCLOSE in Auto Trading?
Code: Select all
Input: MyTime(1528);
If time >= MyTime then begin
Sell ("_LX_") Next Bar at Market;
BuytoCover("_SX_") Next Bar at Market;
end;
Super
The code reads computer time so it should not matter, however you have to remeber what Khalaad suggested.Super,
Your code is correct but I should use 1 min or 5 min bar to run the system. If I use 30 min bar or 15 min bar, the system will exit 30 min or 15 min before the market close. The exit price and the real market close may have a big difference.
There is a very elgant code posted on TS forum by Goose and I use it with great effect. (EoD Exit)
Message me if you do not have access to TS forum.
Regards
Super
hi,Here's link to the code you are looking for.Super,
Where is the code?
https://www.TS.com/Discussion ... xactMatch=
Regards
Super
some of us don't have access to TS forum,
could you kindly paste the code here ?
thanks appreciate it.
Here's it.hi,Here's link to the code you are looking for.Super,
Where is the code?
https://www.TS.com/Discussion ... xactMatch=
Regards
Super
some of us don't have access to TS forum,
could you kindly paste the code here ?
thanks appreciate it.
[/code]
- Attachments
-
- Eod Exit.ELD
- (11.28 KiB) Downloaded 552 times