PDA

View Full Version : my Trade data for multiple securities is invalid


sun4711
7th February 2004, 02:46 AM
Hi David
I cannot get the Trade Database to give with the data
My exploration is
{=== SET DATE VARIABLES ===}
DayStart := 1;MthStart := 1;YearStart := 2000;
DayStop := 31;MthStop := 1;YearStop := 2004;

{=== LONG TRADES ===}

LongEntryTrigger :=
Cross(C,Ref(HHV(H,20),-1))
AND ATR(30)/C*100>1
AND ATR(30)/C*100<10
AND C>0.5
AND Mov(C*VOLUME,21,S)>=50000
AND Mov(C,200,S)>Ref(Mov(C,200,S),-50)+3.6*ATR(30)
AND BarsSince(Mov(C,3,S) - Ref(Mov(C,3,S),-1)<0)<=3;
{Bullish neg gradient of a mov av gate}

LongEntryPrice := OPEN>=Ref(C,-1)+0.01{last C + 0.01}
AND OPEN<=Ref(LLV(L,5)+3.6*ATR(30),-1);
NewEntryTrigger:=Ref(LongEntryTrigger,-1) AND OPEN=Ref(LongEntryPrice,-1);

LongExitTrigger:=C<=Ref(LLV(L,5),-1);
LongExitPrice := OPEN;
LongInitialStop := OPEN - Ref(LLV(L,5)+3.6*ATR(30),-1);

ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.SetStartRecordDate",DayStart,MthStart,YearStart);
ExtFml( "TradeSim.SetStopRecordDate",DayStop,MthStop,YearStop);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.SetExitPriceToInitialStop");
ExtFml( "TradeSim.SetStopGapPriceToOpen");
ExtFml( "TradeSim.EnableProtectiveStop",0);
ExtFml( "TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml( "TradeSim.EnableTradePyramiding",PercentProfit, 5, 20);
ExtFml( "TradeSim.RecordTrades",
"JE 20day high backtest2 ",Long,LongEntryTrigger,LongEntryPrice,LongInitialS top,LongExitTrigger,LongExitPrice,START);

.................................................. ...............................
The error reports of the Explorer of Metastock read to show just a few...

Security Name Reason for Rejection Location
ALCOA INC. CHESS DEPOSITARY INT Error in column A: Period value out of valid range in Mov() function. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
A1 MINERALS LIMITED ORDINARY Error in column A: Period value out of valid range in Mov() function. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
ABB GRAIN LIMITED ORDINARY B CLASS 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. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
A.B.C. LEARNING ORDINARY 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. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
ABELLE LIMITED ORDINARY 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. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
ALCHEMIA LIMITED ORDINARY Error in column A: Period value out of valid range in ATR() function. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
ADELAIDE BANK ORDINARY 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. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
ADTRANS GROUP ORDINARY 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. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
internal error. Referenced DLL: "TradeSim.RecordTrades" DLL Message: Invalid security data detected - Check the Error Log for details. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
GREAT PACIFIC CAP. ORDINARY Error in column A: Period value out of valid range in Mov() function. C:\Trading Data\Stocks\ASX\Custom Folders\ASX Fully Paid Ordinary
.............................................
The Trade Database Error report says
"no valid trading records"
........................................

I can understand the "valid out of range Mov() function" I suppose the security has not been around long enough. It is the ïnvalid security data detected" that is my puzzle

I tested each of my entry triggers individually as an indicator on individual Metastock charts and they work.

I guess is is my entrance and exit triggers that is the problem.

I thought the Page 51NewEntryTrigger would help but no. Can you help me please?

David Samborsky
7th February 2004, 03:10 AM
Your entry price maybe the problem;

LongEntryPrice := OPEN>=Ref(C,-1)+0.01{last C + 0.01}
AND OPEN<=Ref(LLV(L,5)+3.6*ATR(30),-1);

The following expressions equate to 1 or 0 depending on the outcome. This means the total price will either be 0,1 or 2 which has nothing to do with the actual price data. Is this what you want?

OPEN>=Ref(C,-1) + 0.01
OPEN<=Ref(LLV(L,5)+3.6*ATR(30),-1)

In any event the RecordTrades function will reject the trades because the entryprice falls outside the daily range. Just try replacing your entry price with something simple such as OPEN and then reformulate it from there.

sun4711
7th February 2004, 03:22 AM
Hi David
Wow, reply in 5 minutes. Thanks. I am trying to entry buy if the next day the price is between yesterdays close + 1 cent and a maximum price. No dips or big gap ups for me. I shall get rid of the implied ïf"statements.
Thanks
Sun4711