mary1
11th January 2008, 05:37 AM
Hi Jose,
There are two problems iwith the code below in using tradesim. The first one is tradesim does not seems to record the sell trades. Only buy trades are recorded. However when the sell trade code is placed above the buy code, tradesim does not record the buy trades and record only the sell trades.
The system is a simple breakout system where if filled, exit at the close on the same bar as entry.
Under the exploration result tab, no securities are report. And under reject tab, Error in column A: An MSX DLL is reporting an internal error. Referenced DLL: "TradeSim.RecordTrades" DLL Message: Invalid security data detected - Check the Error Log for details. However the trb have buy trades recorded.
The second problem is as regarding the previous post with using two exit method and exit price. The system is a breakout system where if filled, exit at the close (No delay) when RSI(C,10)>75 or exit at the open (no delay) if the open is less than yesterday close, whichever comes first. The code does not seems to differentiate if exit on rsi use close exit price and if exit on O<ref(C,-1) use open as exit price.
-----------------------------------------------------
EntryPrice1 := O+((Ref(H,-1)-Ref(L,-1)));
EntryTrigger1 := OPEN;
ExitPrice1 := Close;
ExitTrigger1 := Close;
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
Tally:=ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Long, { Trade Position Type }
EntryTrigger1, { Entry Trigger }
EntryPrice1, { Entry Price }
InitialStop1, { Initial Stop }
ExitTrigger1, { Exit Trigger }
ExitPrice1, { Exit Price }
Start); { Trade Recorder Control }
EntryPrice2 := O-((Ref(H,-1)-Ref(L,-1)));
EntryTrigger2 := OPEN;
ExitPrice2 := Close;
ExitTrigger2 := Close;
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
Tally:=Tally + ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Short, { Trade Position Type }
EntryTrigger2, { Entry Trigger }
EntryPrice2, { Entry Price }
InitialStop2, { Initial Stop }
ExitTrigger2, { Exit Trigger }
ExitPrice2, { Exit Price }
Continue); { Trade Recorder Control }
Tally;
-------------------------------------------------------
EntryPrice1 := O+((Ref(H,-1)-Ref(L,-1)));
EntryTrigger1 := OPEN;
ExitPrice1 := Close or open;
ExitTrigger1 := Rsi(C,10) > 75 Or O<Ref(C,-1);
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Long, { Trade Position Type }
EntryTrigger1, { Entry Trigger }
EntryPrice1, { Entry Price }
InitialStop1, { Initial Stop }
ExitTrigger1, { Exit Trigger }
ExitPrice1, { Exit Price }
Start); { Trade Recorder Control }
-------------------------------------------------------
There are two problems iwith the code below in using tradesim. The first one is tradesim does not seems to record the sell trades. Only buy trades are recorded. However when the sell trade code is placed above the buy code, tradesim does not record the buy trades and record only the sell trades.
The system is a simple breakout system where if filled, exit at the close on the same bar as entry.
Under the exploration result tab, no securities are report. And under reject tab, Error in column A: An MSX DLL is reporting an internal error. Referenced DLL: "TradeSim.RecordTrades" DLL Message: Invalid security data detected - Check the Error Log for details. However the trb have buy trades recorded.
The second problem is as regarding the previous post with using two exit method and exit price. The system is a breakout system where if filled, exit at the close (No delay) when RSI(C,10)>75 or exit at the open (no delay) if the open is less than yesterday close, whichever comes first. The code does not seems to differentiate if exit on rsi use close exit price and if exit on O<ref(C,-1) use open as exit price.
-----------------------------------------------------
EntryPrice1 := O+((Ref(H,-1)-Ref(L,-1)));
EntryTrigger1 := OPEN;
ExitPrice1 := Close;
ExitTrigger1 := Close;
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
Tally:=ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Long, { Trade Position Type }
EntryTrigger1, { Entry Trigger }
EntryPrice1, { Entry Price }
InitialStop1, { Initial Stop }
ExitTrigger1, { Exit Trigger }
ExitPrice1, { Exit Price }
Start); { Trade Recorder Control }
EntryPrice2 := O-((Ref(H,-1)-Ref(L,-1)));
EntryTrigger2 := OPEN;
ExitPrice2 := Close;
ExitTrigger2 := Close;
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
Tally:=Tally + ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Short, { Trade Position Type }
EntryTrigger2, { Entry Trigger }
EntryPrice2, { Entry Price }
InitialStop2, { Initial Stop }
ExitTrigger2, { Exit Trigger }
ExitPrice2, { Exit Price }
Continue); { Trade Recorder Control }
Tally;
-------------------------------------------------------
EntryPrice1 := O+((Ref(H,-1)-Ref(L,-1)));
EntryTrigger1 := OPEN;
ExitPrice1 := Close or open;
ExitTrigger1 := Rsi(C,10) > 75 Or O<Ref(C,-1);
InitialStop1 := 0; { optional initial stop }
ExtFml("TradeSim.Initialize"); { Initialize internal variables }
ExtFml("TradeSim.EnableDelayOfEntryByOneBar"); { delay entry trigger by one bar}
ExtFml("TradeSim.InitializeValues"); { always include this call }
ExtFml("TradeSim.AssignValue",PointValue,"S&P",250);
ExtFml( "TradeSim.RecordTrades",
"S&P", { Trade Data Filename }
Long, { Trade Position Type }
EntryTrigger1, { Entry Trigger }
EntryPrice1, { Entry Price }
InitialStop1, { Initial Stop }
ExitTrigger1, { Exit Trigger }
ExitPrice1, { Exit Price }
Start); { Trade Recorder Control }
-------------------------------------------------------