GeeBee
6th May 2005, 08:49 AM
Hi again
Can someone please point me in the right direction with coding a short selling system, I have read through the manual and cant find an example of how to code for it.
I have a system that I have manually tested in Metastock I just need to tell Tradesim what I want?????
The code is
{Trigger} Cross(Ref(Trough(1,CLOSE,5),-1),(C))AND {CloseBelowPreviuosTrough Trigger}
{Gate 1}ATR(14)/C>0.01 AND
{Gate 2}Mov(C,21,S)*Mov(V,21,S)>150000 AND
{Gate 3}C>0.5 AND
{Gate 4 }Mov(C,60,S)<Ref(Mov(C,60,S),-20)-2.5*ATR(60)AND
{Gate 5 } V>1
I just need to be able to code the rest in,my initial stop and trailing stop are a close above the HHV(H,5),-1
I have tried renaming everything from long to short etc but metastock doenst recognise anything.
Once again any assistance is greatly appreciated
GB :?
LongExitPrice := OPEN;
LongEntryTrigger:= ExtFml("TradeSim.TrailingStop",TRIGGER,SHORT,Ref(HHV(H,5),-1),LOW,CLOSE);
LongEntryPrice := OPEN;
LongInitialStop := Ref(HHV(H,5),-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",
"CBPT", SHORT,
LongEntryTrigger,
LongEntryPrice,
LongInitialStop,
LongExitTrigger,
LongExitPrice,
Start );
Can someone please point me in the right direction with coding a short selling system, I have read through the manual and cant find an example of how to code for it.
I have a system that I have manually tested in Metastock I just need to tell Tradesim what I want?????
The code is
{Trigger} Cross(Ref(Trough(1,CLOSE,5),-1),(C))AND {CloseBelowPreviuosTrough Trigger}
{Gate 1}ATR(14)/C>0.01 AND
{Gate 2}Mov(C,21,S)*Mov(V,21,S)>150000 AND
{Gate 3}C>0.5 AND
{Gate 4 }Mov(C,60,S)<Ref(Mov(C,60,S),-20)-2.5*ATR(60)AND
{Gate 5 } V>1
I just need to be able to code the rest in,my initial stop and trailing stop are a close above the HHV(H,5),-1
I have tried renaming everything from long to short etc but metastock doenst recognise anything.
Once again any assistance is greatly appreciated
GB :?
LongExitPrice := OPEN;
LongEntryTrigger:= ExtFml("TradeSim.TrailingStop",TRIGGER,SHORT,Ref(HHV(H,5),-1),LOW,CLOSE);
LongEntryPrice := OPEN;
LongInitialStop := Ref(HHV(H,5),-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",
"CBPT", SHORT,
LongEntryTrigger,
LongEntryPrice,
LongInitialStop,
LongExitTrigger,
LongExitPrice,
Start );