Hi
I trying to built a strategy for the futures market to test the day of the week concept with a certain price pattern based on Larry William's long-term secrets to short-term to trading book.
Entry rules:
1. Todays open is less than yesterday (gap on open)
2. Todays close is less than the open
3. If tomorrow is a certain day of the week then place a buy stop above the high of today plus 1% of the 5 day ATR.
Exit rule:
1. Exit on the first profitable open (open is above entry price).
2. Stoploss - exit on the next day open if close is below the entry price - 0.5 * 5day ATR
The problem is sometime the profitable open exit or stoploss exit conditional will be on the wrong day.
Any help will be much appreciated.
//////////////////////////////////////////////////////////////////////////////////////
DayStart := 1; MonthStart := 1; YearStart := 1990;
DayStop :=31; MonthStop :=12; YearStop := 2013;
Limit:= Ref(H + 0.01*ATR(5),-1);
EntryTrigger :=
DayOfWeek()=2
AND H >= Limit
AND Ref(
O < Ref(C,-1)
AND C < O
,-1);
EntryPrice := Limit;
ExitTrigger := O > Ref(EntryPrice,-1);
ExitPrice := O;
InitialStop := EntryPrice - Ref(0.5*ATR(5),-1);
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.SetStartRecordDate", DayStart, MonthStart, YearStart);
ExtFml("TradeSim.SetStopRecordDate", DayStop, MonthStop, YearStop);
ExtFml("TradeSim.EnableProtectiveStop",0);
ExtFml("TradeSim.SetStopGapPriceToOpen");
ExtFml("TradeSim.EnableTradePyramiding",Trigger,0,100);
ExtFml("TradeSim.UseClosingPriceAsStopThreshold");
ExtFml("TradeSim.RecordTrades","DayOfWeek_GapFilling",
LONG,EntryTrigger,EntryPrice,InitialStop,ExitTrigger,ExitPrice,START);