slipperx
22nd June 2007, 12:51 AM
Hi Jose et al
Maybe you can help me - please. The system I wish to test contains a set of trigger criteria and if those criteria are met (let's say on Day 1) the system will look to enter the market 5% below the close of the Trigger bar on Day 2. If the trigger conditions remain on the day 2 as well as Day 1 then it will enter a second position (re-enter the Pyramid if you like) the next Day (Day 3) at the open.
TradeSim handles Pyramid trades using the Trigger criteria and EntryPrice. TradeSim will also enter PyramidTrades at the EntryPrice BUT if the entryprice is not met on the day of entry it will automatically adjust the entry price to a valid market price. In this way unless you are entering next bar at OPEN or CLOSE (the only two sure entry prices from an EOD chart) then TradeSim will happily change the system criteria and enter at a price it derives from market action. As a system trader I find this very disturbing since the system testing software is adjusting my system parameters to suit itself.
I wish to enter my Pyramid Trades (those higher than Level 0) at the open so the paragraph above should not have been an issue for me. However because I wish to Enter the lowest level of the Pyramid (first trade of the set if you like) at a price 5% below the previous close I figured I had better check that that price actually existed in the market (otherwise Tradesim will presumably take the trade at a price other than my real world limit order price - highly undesirable as far as testing the system goes) so I coded the following:
EntryTrigger:= LOW <= Int(Ref(C,-1) * 0.95) AND
"The rest of the Trigger criteria" ;
EntryPrice:= If(O<Ref(C,-1)*0.95, O, Int(Ref(C,-1) * 0.95)); "Enters at the open if the stock gaps more than 5% below the previous close)
ExitTrigger := Ref(C > Mov(C,10,S),-1);
ExitPrice := OPEN;
InitialStop :=0;
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.EnableTradePyramiding",Trigger,0,1);
ExtFml("TradeSim.RecordTrades",
"Filename",
LONG,
EntryTrigger,
EntryPrice,
InitialStop,
ExitTrigger,
ExitPrice,
START);
Problem here is that the Pyramid uses the entry trigger which in my case checks the LOW is 5% below the previous close - a check I do not need since it is not relevant for the Pyramid Level 1 entry of my system AND the entry is 5% below the close as that is the Entryprice for the initial trade rather than the Open which my system wishes to re-enter pyramids at.
I also tried the adding the following line of code immediately before the RecordTrades line:
ExtFml("TradeSim.SetPyramidProfitThresholdDetection",ExitPrice);
The manual states that this will enter the trade at the last parameter checking the profit threshold set in the EnableTradePyramiding value (in this case 0) but that does not provide different results (though I readily admit I am using it for a purpose other than intended by the programmer).
Fortunately the coding for the EntryTrigger prevents TradeSim amending the system entry prices for the re-entry since it checks the price exists in the market before triggering the trigger.
Is there any way of coding this so that the Pyramid levels above 0 are entered at the Open and maintaining the intial trade entry at a price below the market without fear of the system prices being adjusted by TradeSim please?
slipperx (Thailand)
Maybe you can help me - please. The system I wish to test contains a set of trigger criteria and if those criteria are met (let's say on Day 1) the system will look to enter the market 5% below the close of the Trigger bar on Day 2. If the trigger conditions remain on the day 2 as well as Day 1 then it will enter a second position (re-enter the Pyramid if you like) the next Day (Day 3) at the open.
TradeSim handles Pyramid trades using the Trigger criteria and EntryPrice. TradeSim will also enter PyramidTrades at the EntryPrice BUT if the entryprice is not met on the day of entry it will automatically adjust the entry price to a valid market price. In this way unless you are entering next bar at OPEN or CLOSE (the only two sure entry prices from an EOD chart) then TradeSim will happily change the system criteria and enter at a price it derives from market action. As a system trader I find this very disturbing since the system testing software is adjusting my system parameters to suit itself.
I wish to enter my Pyramid Trades (those higher than Level 0) at the open so the paragraph above should not have been an issue for me. However because I wish to Enter the lowest level of the Pyramid (first trade of the set if you like) at a price 5% below the previous close I figured I had better check that that price actually existed in the market (otherwise Tradesim will presumably take the trade at a price other than my real world limit order price - highly undesirable as far as testing the system goes) so I coded the following:
EntryTrigger:= LOW <= Int(Ref(C,-1) * 0.95) AND
"The rest of the Trigger criteria" ;
EntryPrice:= If(O<Ref(C,-1)*0.95, O, Int(Ref(C,-1) * 0.95)); "Enters at the open if the stock gaps more than 5% below the previous close)
ExitTrigger := Ref(C > Mov(C,10,S),-1);
ExitPrice := OPEN;
InitialStop :=0;
ExtFml("TradeSim.Initialize");
ExtFml("TradeSim.EnableTradePyramiding",Trigger,0,1);
ExtFml("TradeSim.RecordTrades",
"Filename",
LONG,
EntryTrigger,
EntryPrice,
InitialStop,
ExitTrigger,
ExitPrice,
START);
Problem here is that the Pyramid uses the entry trigger which in my case checks the LOW is 5% below the previous close - a check I do not need since it is not relevant for the Pyramid Level 1 entry of my system AND the entry is 5% below the close as that is the Entryprice for the initial trade rather than the Open which my system wishes to re-enter pyramids at.
I also tried the adding the following line of code immediately before the RecordTrades line:
ExtFml("TradeSim.SetPyramidProfitThresholdDetection",ExitPrice);
The manual states that this will enter the trade at the last parameter checking the profit threshold set in the EnableTradePyramiding value (in this case 0) but that does not provide different results (though I readily admit I am using it for a purpose other than intended by the programmer).
Fortunately the coding for the EntryTrigger prevents TradeSim amending the system entry prices for the re-entry since it checks the price exists in the market before triggering the trigger.
Is there any way of coding this so that the Pyramid levels above 0 are entered at the Open and maintaining the intial trade entry at a price below the market without fear of the system prices being adjusted by TradeSim please?
slipperx (Thailand)