PDA

View Full Version : number of trades in database


Darlene
13th November 2004, 06:25 AM
Hi Jose and David,
Can you please tell me why I get a different number of trades in the database from metastock to tradesim when I change the exit trigger from c< (end of day) to L< (intraday exit). I use the pyramid function to get all triggers - so the number of eligible trades should be the same - its just the profitability that should change isn't it? (As the entry criteria remain completely unchanged.)
end of day eixt code:
ExitTrigger := C<Ref(LLV(L,12),-1);
ExitPrice := OPEN;

Initialstop:= Ref(LLV(L,3),-1)-0.01;

ExtFml( "TradeSim.Initialize") ;
ExtFml( "TradeSim.SetStartRecordDate", 1,1,1992);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.EnableDelayOfAllExitsByOneBar") ;
ExtFml( "TradeSim.EnableProtectiveStop",0) ;
ExtFml( "TradeSim.UseClosingPriceAsStopThreshold") ;
ExtFml( "TradeSim.EnableTradePyramiding", Trigger, 0, 100) ;
ExtFml( "TradeSim.RecordTrades", "AcloseEOD", Long, EntryTrigger, EntryPrice, InitialStop, ExitTrigger, ExitPrice, Start);


Intraday exit code:
ExitTrigger := L<Ref(LLV(L,12),-1);
ExitPrice := Ref(LLV(L,12),-1)-0.01;
ExitPrice := If(O<ExitPrice,O,exitprice);
ExitPrice := If(ExitPrice<L,L,ExitPrice);

Initialstop:= (Ref(LLV(L,3),-1)-0.01);

ExtFml( "TradeSim.Initialize") ;
ExtFml( "TradeSim.SetStartRecordDate", 1,1,1992);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.EnableProtectiveStop",0) ;
ExtFml( "TradeSim.SetExitPriceToInitialStop") ;
ExtFml( "TradeSim.SetStopGapPriceToOpen");
ExtFml( "TradeSim.EnableTradePyramiding", Trigger, 0, 100) ;
ExtFml( "TradeSim.RecordTrades", "Alow-c", Long, EntryTrigger, EntryPrice, InitialStop, ExitTrigger, ExitPrice, Start);


Cheers
Darlene

Jose
13th November 2004, 09:40 PM
Can you please tell me why I get a different number of trades in the database from metastock to tradesim when I change the exit trigger from c< (end of day) to L< (intraday exit).


Simple:
L<Ref(LLV(L,12),-1) and C<Ref(LLV(L,12),-1) are different exits.


jose '-)[/quote]

Darlene
14th November 2004, 05:41 AM
Hi Jose,

I know they are different exits - but why does that change the number in the database?
I use the pyramiding function to capture all triggers - so as the entry conditions have not changed, why would there be a different number of actual trades?
I realise the exit dates and prices would be different - but don't know why the database would not include some trades for one exit and include others for a different exit. In practice, if I run the daily explorer to identify entries - they are the same - regardless of how I then decide to exit them.

Please explain further.
Cheers
Darlene

Jose
14th November 2004, 09:22 PM
Exits affect the entries in any system.
Normally you may have additional entry signals after the first one appears, which are subsequently disregarded because you are already in that trade. A tighter (earlier) exit will allow new entry points to be taken.

I'll leave it up to David to explain the Pyramiding stuff, as it's not my expertise.

jose '-)

Darlene
15th November 2004, 02:09 AM
Thanks Jose - that was my understanding - thus why I use the pyramiding function - to see what happens to the trades that also trigger while the original trade was open. (It allows for a later entry if my capital was fully utilzed the day of the original trigger - and also means I do not have to cross check every trade that comes up on my daily explorers - to see that they are in fact level 0 trades.)

So David - if you can shed any light on why the database would have a different number of trades this would be really appreciated.

Cheers
Darlene