Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Wolf Wave indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wolf Wave indicator

    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;

    #2
    Wolf Wave

    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

    Comment


      #3
      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.
      Attached Files

      Comment


        #4
        that's the one

        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?

        Comment


          #5
          Originally posted by castille View Post
          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?:



          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.

          Comment


            #6
            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
            Last edited by astra; 12-08-2009, 09:59 AM.

            Comment


              #7
              Originally posted by astra View Post
              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?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              2 views
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,266 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X