[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: formula trouble



PureBytes Links

Trading Reference Links

ricko, this gives the green up arrows, but does not give the down yellow. There is a problem somewhere. Marshall
 
 
-------Original Message-------
 
Date: 07/06/05 00:20:19
Subject: [amibroker] Re: formula trouble
 
I have made a stab at translating the code.
I have to assume that the function LSR() is LinRegSlope()
I have also added a line to plot the stock.

Perhaps someone can check this code

LRSBval= -0.12; LRSSval = 0.11;
Length3 = Length4 = FDBLen = FDSLen = MAvgLen = 20;
FDBuy = 6; FDSell = 94; PctAbvMA = .1; PctBlwMA = .05;
PctAbvMAValue = MA(C,MAvgLen) * (100- PctAbvMA) / 100;
PctBlwMAValue = MA(C,MAvgLen) * (100+ PctBlwMA) / 100;
FDBVal = StochD(FDBLen);

FDSVal = StochD(FDSLen);
condition1 = C < PctAbvMAValue;
condition2 = C > PctBlwMAValue;
condition3 = LinRegSlope(C,length3)*LRSSval;
condition4= LinRegSlope(C,20)>LRSSval;
condition5= (FDBVal <= FDBuy AND FDBVal > Ref(FDBVal,-1)) OR (Ref
(FDBVal, -1) <= FDBuy AND FDBVal > Ref(FDBVal,-1));
condition6= (FDSVal >= FDSell AND FDSVal < Ref(FDSVal,-1)) OR (Ref
(FDSVal,-1) >= FDSell AND FDSVal < Ref(FDSVal,-1));
PlotShapes((condition1 AND condition3 AND condition5)*shapeUpArrow,
colorBrightGreen,0,L);
PlotShapes((condition2 AND condition4)
*shapeDownArrow,colorYellow,0,H);
Plot(C,"",colorGreen,64);

Hope it helps
Rick

--- In amibroker@xxxxxxxxxxxxxxx, "m.smith" <ink@xxxx> wrote:
>
> 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;




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software Stock investment software
 
Add FUN to your email - CLICK HERE!

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS