PDA

View Full Version : Trade Pyramiding & Protective Stop - change to functiona


tamarac
23rd February 2004, 06:20 AM
Hi David,

Is there any chance that we might be able to use the protective stop function with pyramiding in the future?

I was testing a system using a fixed initial/protective stop and moving average exit strategy rather than a trailing stop as per code below. I was hoping I could combine this with trade pyramiding.

LongExitTrigger:=C<=Ref(Mov(C,10,VAR),-1);
LongInitialStop:=Ref(Mov(C,4,S),-1);

I was considering 2 scenarios: the initial protective stop would only be called for the initial trade, or alternatively a protective stop would be calculated for each pyramid trade.

Is this impossible with metastock code?

Regards,
Tamara

Jose
23rd February 2004, 06:24 AM
Try Richard's Advanced Trailing Stop:
http://www.tradernexus.com/advancedstop/advancedstop.html

"TRADE STAGES

The Advanced Stop system also allows you to plot a binary indicator that will indicate which "stage" of the trade you're on (very useful if you want to create an expert advisor).

The stages are:
0 - Not in a trade
1 - In trade, current stop being used is initial stop, trade is still underneath transition point to breakeven stop.
2 - In trade, trailing profit stop used
3 - In trade, price is past first pyramid point
4 - In trade, price is past second pyramid point
-1 - Trade stopped out on initial stop
-2 - Trade stopped out on trailing profit stop (or breakeven stop if this is being used)
-3 - Trade stopped out on first pyramid trailing profit stop
-4 - Trade stopped out on second pyramid trailing profit stop.

This trade stage system is also fantastic if you are developing trading systems with very specific defined entry points."

jose '-)

tamarac
25th February 2004, 03:27 AM
Thanks Jose - this was very helpful.

For anyone that's interested below is a simple example using Richard's formula which will fit the 1st scenario I described above - ie. still achieve a protective stop on the initial trade with trade pyramiding enabled.

LongFStop:=Ref(Mov(C,4,S),-1);
LongTStop:=Ref(Mov(C,10,VAR),-1);
LongTStop1:=LongTStop;
LongTStop2:=LongTStop;
LongPyramid1:=(C-LongEntryPrice)/LongEntryPrice>0.04;
LongPyramid2:=LongPyramid1
LongAdvStop:=ExtFml("AdvancedStop.StopLong",LongEntryTrigger,LongFStop,0,LongTStop,LongPyrami d1,LongTStop1,LongPyramid2,LongTStop2);
LongExitTrigger:=C<=LongAdvStop;
LongInitialStop:=LongAdvStop;

Regards,
Tamara