PDA

View Full Version : Wolf Wave indicator


BC5391
09-23-2007, 09:05 AM
Is any one able to convert the folling code to Ninjatrader?
The code draws the wolf Wave pattern as taught by Bill Wolfe.


Inputs: NBars(13), {Number of bars for Swing_Lee pivot picking }
MaxBars(250); {Maximum number of bars forward to search for }
{Match/Crossing of ETA lines to set end EPA }
{If this is set to a very high number, the time}
{to compute and plot will become excessive. }
Vars: TPCount(0),Direct(0),
HoldPrice(0),BarsBk(0),
Slope1(0),Slope2(0),
ETA1(0),ETA2(0),EPA(0),
NewDate(0),NewTime(0);
Arrays: TPDate[4](0),TPTime[4](0),TPBar[4](0),TPPrice[4](0),TPDirect[4](0);
Direct=Swing_Lee_Simple(NBars,False);
If Sign(Direct)<>Sign(Direct[1]) then begin
BarsBk=AbsValue(Direct);
{Found a TurningPoing so increase count}
TPCount=TPCount+1;
{Save the proper price}
If Direct<0 then HoldPrice=High[BarsBk]
else HoldPrice=Low [BarsBk];
{Push the Stack}
For Value1=1 to 3 begin
TPDate[Value1] =TPDate[Value1+1];
TPTime[Value1] =TPTime[Value1+1];
TPBar[Value1] =TPBar[Value1+1];
TPPrice[Value1] =TPPrice[Value1+1];
TPDirect[Value1]=TPDirect[Value1+1];
End;
{Save Current Data}
TPDate[4] =Date[BarsBk];
TPTime[4] =Time[BarsBk];
TPBar[4] =CurrentBar-BarsBk;
TPPrice[4] =HoldPrice;
TPDirect[4]=Sign(Direct);
Plot1[BarsBk](HoldPrice,"TP");
If TPCount>3 then begin
{If we have 4 TP's then we can look for WW}
Condition1=False;Condition2=False;
Slope1=(TPPrice[3]-TPPrice[1])/(TPBar[1]-TPBar[3]);
Slope2=(TPPrice[4]-TPPrice[2])/(TPBar[2]-TPBar[4]);
If TPDirect[1]>0 then begin
{Look for Bullish WW}
Condition1=
TPPrice[4]>TPPrice[3] and
TPPrice[4]<TPPrice[2] and
TPPrice[3]<TPPrice[1] and
TPPrice[4]>TPPrice[1] and
Slope1 <Slope2 ;
End
Else Begin
{Look for Bearish WW}
Condition2=
TPPrice[4]<TPPrice[3] and
TPPrice[4]>TPPrice[2] and
TPPrice[3]>TPPrice[1] and
TPPrice[4]<TPPrice[1] and
Slope1 >Slope2 ;
End;
{Plot the wave and lines if it exists}
If Condition1 or Condition2 then begin
ETA1=TL_NEW(TPDate[1],TPTime[1],TPPrice[1],TPDate[3],TPTime[3],TPPrice[3]);
ETA2=TL_NEW(TPDate[2],TPTime[2],TPPrice[2],TPDate[4],TPTime[4],TPPrice[4]);
EPA =TL_NEW(TPDate[1],TPTime[1],TPPrice[1],TPDate[4],TPTime[4],TPPrice[4]);
Value5=TL_New(Date,Time,TL_GetValue(ETA1,Date,Time ),
Date,Time,TL_GetValue(ETA2,Date,Time));
Value1=mod(tpcount,6)+2;
Value1=red;
TL_SetColor(ETA1,VALUE1);
TL_SetColor(ETA2,VALUE1);
TL_SetColor(EPA ,VALUE1);
TL_SetColor(Value5,Red);
TL_SetSize(Value5,3);
Value2=0;
Value1=0;
While Value2=0 and Value1< MaxBars begin
Value2=BarsToDate_Time(TPBar[4]-TPBar[3], Value1, NewDate, NewTime);
Value3=TL_GetValue(ETA2, NewDate, NewTime)-TL_GetValue(ETA1, NewDate, NewTime);
If Condition1 and Value3>0 then Value2=0;
If Condition2 and Value3<0 then Value2=0;
Value1=Value1+1;
End;
If Value2<>0 or Value1=MaxBars then begin
TL_SetEnd(ETA1, NewDate, NewTime, TL_GetValue(ETA1, NewDate, NewTime));
Value7=TL_GetValue(ETA2, NewDate, NewTime);
TL_SetEnd(ETA2, NewDate, NewTime, Value7);
Value8=Text_New(NewDate,NewTime,Value7,"ETA");
Text_SetStyle(Value8, 0, 2);
Value7=TL_GetValue(EPA , NewDate, NewTime);
TL_SetEnd(EPA , NewDate, NewTime, Value7);
Value8=Text_New(NewDate,NewTime,Value7,"EPA");
Text_SetStyle(Value8, 0, 2);
End;
End;
End;
End;

castille
04-04-2009, 06:57 PM
Greetings BC5391,

Just curious if anyone was ever able to covert the Wolf Wave code to Ninja script and turn it into an indicator?

Thanks, Jeff

astra
05-16-2009, 08:17 AM
castille,

Is it the Wolf Wave pattern that you are after like this one in the picture?
If it is this one the nearest indicator available here is the Gartley indicator.
You may be able to alter the settings of Gartley to transform it to Wolf Wave.
Just an idea.

castille
05-16-2009, 09:13 AM
Yes, that is the one. I tried the Gartley indicators but..... for some reason they do not plot on my chart. I can't figure out why. Can they be use for intra-day applications?

astra
05-16-2009, 09:27 AM
Yes, that is the one. I tried the Gartley indicators but..... for some reason they do not plot on my chart. I can't figure out why. Can they be use for intra-day applications?


Have you tried the one that is in here?:

http://www.ninjatrader-support2.com/vb/showthread.php?t=15067&highlight=gartley

This one works for me intraday. Gartley signals are rare, maybe a handful or so a day. Place TolerancePercent quite high 25-35% to see if you get any plots.

astra
05-16-2009, 10:57 AM
castille,

Maybe another reason is that in this Gartley indicator the ZigZag deviation is measured in percentage. I prefer to use points because I have more control of the length of the swing, so I altered the original indicator to accept points instead of percentage. I attach it here in case you find it more responsive.

Cheers

mystiq
05-12-2011, 01:46 AM
castille,

Maybe another reason is that in this Gartley indicator the ZigZag deviation is measured in percentage. I prefer to use points because I have more control of the length of the swing, so I altered the original indicator to accept points instead of percentage. I attach it here in case you find it more responsive.

Cheers


...where is the altered indicator?