GeeBee
1st May 2005, 03:42 AM
Hi everyone this my first post here.
I have just recently bought Tradesim Pro so am on a very steep learning curve.
Would somebody mind having a look at the attached code for a STTC system that I am having trouble coding,
I want to enter the trade on the open the day after the trigger and bid up to 1/2*ATR(10) above trigger day close,my initial stop is Entry price minus 2*ATR(10) and trailing stop is a close below the lowest low in the last five days.
When I put my triggers, gates, stops etc into a Metastock explorer and click OK it has a problem with the LongInitialStop function,I get a meassage that says "This is not a recognised name,constant or operator" ???
LongInitialStop := LongentryPrice-Ref(2.5*ATR(10),-1);
The entire code is as follows
{=== SET DATE VARIABLES ===}
DayStart := 1; MthStart := 1; YearStart := 2001;
DayStop := 31; MthStop := 3; YearStop := 2004;
{=== LONG TRADES ===}
LE := C+0.5*ATR(10);
LongEntryTrigger :=
{T} H>Ref(H,-1)AND
{1}Ref(H,-1)>Ref(H,-2)AND
{2}Ref(H,-2)>Ref(H,-3)AND
{3}Mov(C,120,S)>Ref(Mov(C,120,S),-40)+4*ATR(80) AND
{4}C>0.5 AND
{5}ATR(30)/ C >0.015 AND
{6}Mov(V,21,S)* Mov(C,21,S)>150000 AND
{7}V>1 AND
{8}C>O AND
Ref(L,1)<=LE;
{LongEntryPrice -Ref(0.5*ATR(10),-1);}
LongExitTrigger:=
ExtFml("TradeSim.TrailingStop",TRIGGER,LONG,Ref(LLV(L,5),-1),HIGH,CLOSE);
LongExitPrice := OPEN;
LongInitialStop := LongentryPrice-Ref(2.5*ATR(10),-1);
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.SetStartRecordDate",DayStart,MthStart,YearStart);
ExtFml( "TradeSim.SetStopRecordDate",DayStop,MthStop,YearStop);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml( "TradeSim.EnableProtectiveStop",0);
ExtFml( "TradeSim.UseClosingPriceAsStopThreshold");
ExtFml( "TradeSim.EnableTradePyramiding",Trigger, 0, 200);
ExtFml( "TradeSim.RecordTrades",
"STTC BullmK1",LONG,LongEntryTrigger,LongEntryPrice,LongInitialS top,LongExitTrigger,LongExitPrice,START); { Recorder Control }
Thanks for any advice.
GB
I have just recently bought Tradesim Pro so am on a very steep learning curve.
Would somebody mind having a look at the attached code for a STTC system that I am having trouble coding,
I want to enter the trade on the open the day after the trigger and bid up to 1/2*ATR(10) above trigger day close,my initial stop is Entry price minus 2*ATR(10) and trailing stop is a close below the lowest low in the last five days.
When I put my triggers, gates, stops etc into a Metastock explorer and click OK it has a problem with the LongInitialStop function,I get a meassage that says "This is not a recognised name,constant or operator" ???
LongInitialStop := LongentryPrice-Ref(2.5*ATR(10),-1);
The entire code is as follows
{=== SET DATE VARIABLES ===}
DayStart := 1; MthStart := 1; YearStart := 2001;
DayStop := 31; MthStop := 3; YearStop := 2004;
{=== LONG TRADES ===}
LE := C+0.5*ATR(10);
LongEntryTrigger :=
{T} H>Ref(H,-1)AND
{1}Ref(H,-1)>Ref(H,-2)AND
{2}Ref(H,-2)>Ref(H,-3)AND
{3}Mov(C,120,S)>Ref(Mov(C,120,S),-40)+4*ATR(80) AND
{4}C>0.5 AND
{5}ATR(30)/ C >0.015 AND
{6}Mov(V,21,S)* Mov(C,21,S)>150000 AND
{7}V>1 AND
{8}C>O AND
Ref(L,1)<=LE;
{LongEntryPrice -Ref(0.5*ATR(10),-1);}
LongExitTrigger:=
ExtFml("TradeSim.TrailingStop",TRIGGER,LONG,Ref(LLV(L,5),-1),HIGH,CLOSE);
LongExitPrice := OPEN;
LongInitialStop := LongentryPrice-Ref(2.5*ATR(10),-1);
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.SetStartRecordDate",DayStart,MthStart,YearStart);
ExtFml( "TradeSim.SetStopRecordDate",DayStop,MthStop,YearStop);
ExtFml( "TradeSim.EnableDelayOfEntryByOneBar");
ExtFml( "TradeSim.EnableDelayOfAllExitsByOneBar");
ExtFml( "TradeSim.EnableProtectiveStop",0);
ExtFml( "TradeSim.UseClosingPriceAsStopThreshold");
ExtFml( "TradeSim.EnableTradePyramiding",Trigger, 0, 200);
ExtFml( "TradeSim.RecordTrades",
"STTC BullmK1",LONG,LongEntryTrigger,LongEntryPrice,LongInitialS top,LongExitTrigger,LongExitPrice,START); { Recorder Control }
Thanks for any advice.
GB