I am testing the following code in a 1-min chart
[IntrabarOrderGeneration = True];
Inputs:TT1(81908),TT2(82218);
Vars:TEnt(0), TExit(0);
TEnt=Iff(Currenttime_S>=TT1,1,0);
TExit=Iff(Currenttime_S>=TT2,1,0);
If TEnt=1 then buy this bar at close;
If TExit=1 then sell this bar at close;
I was testing the code at around 8:15:00 with the following expectation.
Expectation: I anticipate that a Buy order would be executed at 8:19:08. And a Sell order would be executed at 8:22:18.
However, the Buy order was executed just after 8:20 (or it is like an end-of-bar signal); while the Sell order was executed just after 8:23 (it is like an end-of-bar signal).
Similarly, I have tested the code on a 5-min chart. The signals were executed as end-of-bar signals.
Could anyone help me to fix it?
One more question: How can I make the code / setting to let MC to issue repetitive signals, e.g for the Buy signal after 8:19:08?
Sa
p/s Additional settings:
Tested currency: EURUSD
Tested account: IB paper trading account
Strategy Properties:
Position Limit (haven't checked anything)
Fixed Shares / Contracts: 20000