This is a "pivot formula" not in amibroker. Will someone look at this and see if it can be translated? I have been hasseling with this probably more than it is worth. Thanks. Marshall
{scalper pivot points } Input: LRSBval(- 0.12), {level which buys must be below} LRSSval(0.11), {level which sells must be above} Length3(20),{Length for Buy LRS} Length4(20),{Length for Sell LRS} FDBLen(20), {Number of bars to use for FastD calculation for Buy side} FDSLen(20), {Number of bars to use for FastD calculation for Sell side} FDBuy(6), {Value of FastD to Signal long entry} FDSell(94), {Value of FastD to Signal Short entry} MAvgLen(20), PctAbvMA(.1), PctBlwMA(.05);
Vars: PctAbvMAValue( 0.0), PctBlwMAValue(0.0), FDBVal(0.0), FDSVal(0.0), FastDValL(0.0), FastDValS(0.0);
PctAbvMAValue = (Average(Close,MAvgLen) * ( 100- PctAbvMA) / 100);
PctBlwMAValue = (Average(Close,MAvgLen) * ( 100+ PctBlwMA) / 100);
FDBVal = FastD(FDBLen);
FDSVal = FastD(FDSLen); condition1 = C < PctAbvMAValue;
condition2 = C > PctBlwMAValue;
condition3=LinearregSlope(C,length3)LRSSval;
condition4= LRS(C, 20)>LRSSval;
condition5= (FDBVal <= FDBuy AND FDBVal > FDBVal[ 1]) OR (FDBVal[1] <= FDBuy AND FDBVal > FDBVal[1]);
condition6= (FDSVal >= FDSell AND FDSVal < FDSVal[ 1]) OR (FDSVal[1] >= FDSell AND FDSVal < FDSVal[1]);
if condition1 AND condition3 AND condition5 then begin Plot1(L - .5,"GoLong"); end; if condition2 AND condition4 AND condition6 then begin Plot2(H + .5,"GoShort");
end; |