2nd Question: How can I stop trading at lastHour of friday?
actually they are the same question I think.
Here is the thing. MC will automatically reverse my entry signals.
For example the simplest trading strategy may looks like this:
u don't need a exit signal. Usually, it works fine. but in some circumstances, I don't want to let MC close my open position and establish a reversal position at the same time. for example, I just want the system stop trading at the lasthour of friday.---------------------code start --------------
MA1 = MA(10);
MA2 = MA(20);
if MA1 crossover MA2 then
buy 1 contract next bar at open;
if MA2 crossover MA1 then
sellshort 1 contract next bar at open;
------------------code end----------------------
here is my code to do this, which is not work actually.
I just want to know whether there is any good solution for this?--------------- code start -----------------------------
MP = MarketPosition;
if dayofweek(date) = friday and LastHour then begin
if MP = 1 then
sell currentcontracts contracts this bar at close;
if MP = -1 then
buytocover currentcontracts contracts this bar at close;
end else begin
// we start to trading from here.
end;
--------------code end ----------------------------------