Hoi,
Bij deze strategy geeft de vestics editor geen fouten. Na invoegen in een grafiek komt er geen plot.
Wie kan zeggen hoe dit op te lossen ?
gr.
willie
---------------------
http://www.traders.com/Documentation/FE ... adestation
{Indicator: JB Volatility Strat }
inputs:
HighestHighRange( 20 ),
LowestLowRange( 20 ),
LongATR_Len(10 ),
LongTrailLen( 15 ),
LongProfitTakerLen(13),
WeeklyAverageLength( 34 ),
?RSIEntryThreshold( 30 ),
RSI_Length( 7 ),
?RSISignalLen( 10 ),
?RecentLowLen(3);
variables:
LowestLow(0),
LongATR( 0 ),
EntryLong(0),
LongStop(0),
LongProfitTarget(0),
WeeklyAverage(0),
RSISignalCounter( 0 ),
?MP( 0 ),
?ImmedStop(0),
LongStopCrossed( False ),
MaxLongStop(0);
Value1 = RSI(close, RSI_Length);
if Value1 crosses over RSIEntryThreshold and
Close > Average( Close, 34*5) and
MarketPosition = 0
then
RSISignalCounter = 0 ;
RSISignalCounter = RSISignalCounter + 1 ;
WeeklyAverage = Average( Close, WeeklyAverageLength * 5 );
LowestLow = Lowest(Low, LowestLowRange);
LongATR = AvgTrueRange( LongATR_Len) ;
EntryLong = LowestLow +2*LongATR;
LongStop = Highest(H, LongTrailLen) - 2*LongATR;
LongProfitTarget = XAverage(High,LongProfitTakerLen)+ 2*LongATR ;
MP = MarketPosition ;
if MP = 0 then
begin
LongStopCrossed = False ;
MaxLongStop = LongStop ;
end
else if LongStop > MaxLongStop then
MaxLongStop = LongStop ;
if Close > WeeklyAverage and
MarketPosition = 0 and
WeeklyAverage > WeeklyAverage[5] and
RSISignalCounter < RSISignalLen
then
begin
Buy next bar at EntryLong stop ;
Sell ("LowestLow") next bar at Lowest(Low, RecentLowLen) stop ;
Sell ("Profit Target#1") next bar at LongProfitTarget limit ;
end ;
if MP[1] = 0 and MP = 1 then
begin
RSISignalCounter = RSISignalLen ;
ImmedStop = Lowest(Low,RecentLowLen + 1);
end ;
if MarketPosition = 1 and
Close[1] < MaxLongStop and
Close >= MaxLongStop and
LongStopCrossed = False
then
LongStopCrossed = True ;
if MarketPosition = 1 and
Close < MaxLongStop and
Close[1]<MaxLongStop and
LongStopCrossed
then
Sell ("LongVolStop") next bar market
else if MarketPosition = 1 then
Sell ("ImmedStop") next bar at ImmedStop stop ;
if MarketPosition = 1 then
Sell next bar at LongProfitTarget limit ;
(Edited by willie at 8:53 pm op 8,mar. 2005)