Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dinapoli Stochastic

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

    #16
    Dinapoli

    Hi,
    Does any one have the Dinapoli indicators developed from the correct formulas in his book? If any one is interested in developing these, please get in touch. So long you are ready to code it, I can explain it.
    Cheers.

    Comment


      #17
      They are already on the site... do a search and you can get them.

      The MACD is the only problem as it only takes period INTEGERS and not decimals...
      Attached Files
      Last edited by Virge666; 02-13-2008, 05:28 PM.

      Comment


        #18
        Originally posted by Virge666 View Post
        They are already on the site... do a search and you can get them.The MACD is the only problem as it only takes period INTEGERS and not decimals...
        I see you have a DinoDetrend but I don't seem to be able to find it with the search and I imagined others couldn't either, so here is another version:

        Code:
        [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
        [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
        [FONT=Courier New][SIZE=2][COLOR=#008000]// input: nLength(7);  Sample TS EL code[/COLOR][/SIZE][/FONT]
        [SIZE=2][FONT=Courier New][COLOR=#008000]// var: Detrend(0); [/COLOR][/FONT][/SIZE]
        [SIZE=2][FONT=Courier New][COLOR=#008000]// [/COLOR][/FONT][/SIZE]
        [SIZE=2][FONT=Courier New][COLOR=#008000]// Detrend = Close - Average(Close, nLength); [/COLOR][/FONT][/SIZE]
        [SIZE=2][FONT=Courier New][COLOR=#008000]// plot1(Detrend, "Detrend");[/COLOR][/FONT][/SIZE]
        [FONT=Courier New][SIZE=2]Value.Set(CurrentBar < Period ? Input[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] :Input[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] - SMA (Input , Period)[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] );[/SIZE][/FONT]
        [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
        Regarding MACD decimal periods, you could also calculate Dinapoli DEMA smoothed MACD this way, something easier to visualize and bypassing the decimal periodicity:
        Code:
        {DiNapoli DEMA Smoothed MACD}  in MS code
        Dinap:= Dema(close,8) - Dema(close,17); 
        Signal:= Dema(Dinap,9); 
        Dinap;Signal; {end}
        Attached Files

        Comment


          #19
          Wrong formula

          Hi all,
          Thanks for your very kind posts. I have looked at the code for the stochastic on this thread......it has the wrong formula. Dinapoli stochastic does not use EMA. I not only have Dinapoli's book, I have spoken to him and he actually gave me his own CQG file of indicators (I will never devulge anything that is not already public). I know next to nothing about coding but can explain most aspect of Dinapoli method. I now wish to use ninjatrader hence the need for correct dinapoli indicators on Ninjatrader.

          The detrend posted by "Thrunner" is correct but I would have liked the period to be open rather than tied to 7. This way, one would be able to experiment.

          The code provided for DEMA MACD is confusing to me: what do I do with it? Cut and past in the formula part of a new DEMA indicator? Please some one help!

          May I ask someone to tell me where to find the various types of Averages that can be used in Ninjatrader codes? For example, EMA, SMA....etc.

          One other thing: what woud happen if one copied the current MACD and changed all the interger word to decimal word...would it then accept decimal periods?

          Once again thanks all for sparing your time to post.

          Comment


            #20
            There are two parts in the formula - just change EMA to SMA and you will be OK.

            I am also a bit lost on the MACD . . !!!

            Thrunner . . .Help !

            Comment


              #21
              As Virge has pointed out, you can reuse as much code as possible. For example, TEMA can be mod to DEMA with the following changes and attached please find DEMA.zip.
              Code:
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
              [SIZE=2][FONT=Courier New]ema1.Set(EMA(Input, Period)[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]ema2.Set(EMA(ema1, Period)[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#008000]//ema3.Set(EMA(ema2, Period)[0]);[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#008000]//Value.Set(3 * ema1[0] - 3 * ema2[0] + ema3[0]);[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2]Value.Set([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] * ema1[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] - ema2[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
              You should now be able to mod MACD to do DEMA smoothed MACD.

              Bobo, you can also change the period in the DinapoliDetrend indicator (from 7 to other integer).
              Attached Files
              Last edited by thrunner; 03-03-2008, 07:48 PM. Reason: unnecessary dll removed from indicator

              Comment


                #22
                Mistake

                Hi all,
                This post has been shared into two because it is too long for one post.


                May be this will help: Dinapoli stochastic does not use EMA or SMA. It uses Modified Moving average which is calculated from this formula:

                Where:
                n = number of bars
                MAt = current moving average value
                MAt-1 = previous moving average value
                Pt = current price
                For any one trying to code this, please be reminder that the first point is as good as a mere SMA while every other point is modified.

                On the other hand, I have downloaded Thrunner's DEMA and can add it to a chart but I cannot see it via the editor. I had wanted to see the code to know if it is mathematically correct. I say so because it still does not accept decimal imputs which the DEMA ought to do.
                Below, I have added the correct metatrader codes for both the DEMA and stochastic so anyone who can understand they can get the idea of what is needed.
                Here is the correct DEMA code from metatrader:
                //---- indicator settings
                #property indicator_separate_window
                #property indicator_buffers 2
                #property indicator_color1 Silver
                #property indicator_color2 Red
                //---- indicator parameters
                extern double FastEMA=8.3896;
                extern double SlowEMA=17.5185;
                extern double SignalEMA=9.0503;
                //---- indicator buffers
                double Macd_buffer[];
                double Sign_buffer[];
                double Fast_buffer[];
                double Slow_buffer[];

                //+------------------------------------------------------------------+
                //| Custom indicator initialization function |
                //+------------------------------------------------------------------+
                int init()
                {
                //---- drawing settings
                IndicatorBuffers(4);
                SetIndexBuffer(0,Macd_buffer);
                SetIndexBuffer(1,Sign_buffer);
                SetIndexBuffer(2,Fast_buffer);
                SetIndexBuffer(3,Slow_buffer);
                SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1);
                //SetIndexDrawBegin(0,Bars-1);
                //SetIndexDrawBegin(1,Bars-1);
                //IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
                //---- indicator buffers mapping
                if(!SetIndexBuffer(0,Macd_buffer) && !SetIndexBuffer(1,Sign_buffer))
                Print("cannot set indicator buffers!");
                //---- name for DataWindow and indicator subwindow label
                IndicatorShortName("MACD(DEMA)DiNapoli("+FastEMA+" ,"+SlowEMA+","+SignalEMA+")");
                SetIndexLabel(0,"MACD(DEMA)");
                SetIndexLabel(1,"Signal");
                //---- initialization done
                return(0);
                }
                //+------------------------------------------------------------------+
                //| MACD (DEMA) DiNapoli |
                //+------------------------------------------------------------------+
                int start()
                {


                for(int i=Bars; i>=0; i--)
                {
                Fast_buffer[i]=0.0;
                Slow_buffer[i]=0.0;
                Macd_buffer[i]=0.0;
                Sign_buffer[i]=0.0;
                if (i==Bars) {Fast_buffer[i]=Close[i];Slow_buffer[i]=Close[i];}
                }
                //---- macd counted in the 1-st buffer
                for( i=Bars-1; i>=0; i--)
                {
                Fast_buffer[i]=Fast_buffer[i+1]+2.0/(1.0+FastEMA)*(Close[i]-Fast_buffer[i+1]);
                Slow_buffer[i]=Slow_buffer[i+1]+2.0/(1.0+SlowEMA)*(Close[i]-Slow_buffer[i+1]);
                Macd_buffer[i]=Fast_buffer[i]-Slow_buffer[i];
                }
                //---- signal line counted in the 2-nd buffer
                for(i=Bars-1; i>=0; i--)
                Sign_buffer[i]=Sign_buffer[i+1]+2.0/(1.0+SignalEMA)*(Macd_buffer[i]-Sign_buffer[i+1]);
                //---- done
                return(0);
                }

                The stochastic in metatrader code is:
                //+------------------------------------------------------------------+
                //| StochasticDiNapoli.mq4 |
                //| Copyright © 2006, TrendLaboratory Ltd. |
                //| http://finance.groups.yahoo.com/group/TrendLaboratory |
                //| E-mail: [email protected] |
                //+------------------------------------------------------------------+
                #property copyright "Copyright © 2005, TrendLaboratory Ltd."
                #property link "http://finance.groups.yahoo.com/group/TrendLaboratory"

                #property indicator_separate_window
                #property indicator_minimum 0
                #property indicator_maximum 100

                #property indicator_level1 20
                #property indicator_level2 80
                #property indicator_level3 50

                #property indicator_buffers 2
                #property indicator_color1 DodgerBlue
                #property indicator_color2 Blue
                //---- input parameters
                extern int FastK=8;
                extern int SlowK=3;
                extern int SlowD=3;
                //---- buffers
                double StoBuffer[];
                double SigBuffer[];
                //double MdBuffer[];
                //+------------------------------------------------------------------+
                //| Custom indicator initialization function |
                //+------------------------------------------------------------------+
                int init()
                {
                string short_name;
                //---- indicator line
                SetIndexStyle(0,DRAW_LINE);
                SetIndexStyle(1,DRAW_LINE);

                SetIndexBuffer(0,StoBuffer);
                SetIndexBuffer(1,SigBuffer);

                //---- name for DataWindow and indicator subwindow label
                short_name="Stochastic DiNapoli("+FastK+","+SlowK+","+SlowD+")";
                IndicatorShortName(short_name);
                SetIndexLabel(0,"Stoch");
                SetIndexLabel(1,"Signal");
                //----
                SetIndexDrawBegin(0,FastK);
                SetIndexDrawBegin(1,FastK);
                //----
                return(0);
                }
                //+------------------------------------------------------------------+
                //| Stochastic DiNapoli |
                //+------------------------------------------------------------------+
                int start()
                {
                int i,counted_bars=IndicatorCounted();
                double high,low;
                //----
                if(Bars<=FastK) return(0);
                //---- initial zero
                if(counted_bars<1)
                for(i=1;i<=FastK;i++)
                {StoBuffer[Bars-i]=0.0;SigBuffer[Bars-i]=0.0;}
                //----
                i=Bars-FastK-1;
                if(counted_bars>=FastK) i=Bars-counted_bars-1;
                while(i>=0)
                {
                low=Low[Lowest(NULL,0,MODE_LOW,FastK,i)];
                high=High[Highest(NULL,0,MODE_HIGH,FastK,i)];
                double Fast=(Close[i]-low)/(high-low)*100;
                StoBuffer[i]=StoBuffer[i+1]+(Fast-StoBuffer[i+1])/SlowK;
                SigBuffer[i]=SigBuffer[i+1]+(StoBuffer[i]-SigBuffer[i+1])/SlowD;
                i--;
                }
                return(0);
                }
                //+------------------------------------------------------------------+


                Here is the metatrader dinapoli detrended oscillator for comparing to Thrunner's Ninjatrader version so as to help understand how to port the codes:
                //+------------------------------------------------------------------+
                //| DiNapoli Detrend Oscillator.mq4
                //| Ramdass - Conversion only
                //+------------------------------------------------------------------+

                #property indicator_separate_window
                #property indicator_buffers 1
                #property indicator_color1 Blue



                extern int x_prd=14;
                extern int CountBars=300;
                //---- buffers
                double dpo[];


                //+------------------------------------------------------------------+
                //| Custom indicator initialization function |
                //+------------------------------------------------------------------+
                int init()
                {
                string short_name;
                //---- indicator line
                IndicatorBuffers(1);
                SetIndexStyle(0,DRAW_LINE);
                SetIndexBuffer(0,dpo);
                //----
                return(0);
                }
                //+------------------------------------------------------------------+
                //| DPO |
                //+------------------------------------------------------------------+
                int start()
                {
                if (CountBars>=Bars) CountBars=Bars;
                SetIndexDrawBegin(0,Bars-CountBars+x_prd+1);
                int i,counted_bars=IndicatorCounted();
                double t_prd;
                //----
                if(Bars<=x_prd) return(0);
                //---- initial zero
                if(counted_bars<x_prd)
                {
                for(i=1;i<=x_prd;i++) dpo[CountBars-i]=0.0;
                }
                //----
                i=CountBars-x_prd-1;
                t_prd=x_prd/2+1;

                while(i>=0)
                {
                dpo[i]=Close[i]-iMA(NULL,0,7,MODE_SMA,0,PRICE_CLOSE,i);


                i--;
                }
                return(0);
                }
                //+------------------------------------------------------------------+

                Comment


                  #23
                  Part 2

                  THERE IS EVEN THE DINAPOLI FIBO:
                  //+------------------------------------------------------------------+
                  #property copyright "Rob"
                  #property link "http://www.viac.ru/"

                  #property indicator_chart_window
                  #property indicator_buffers 0
                  //---- input parameters

                  extern double PointA=0;
                  extern double PointB=0;
                  extern double PointC=0;
                  extern double PointF=0;
                  extern double PointF1_blue=0;
                  extern double PointF2_pink=0;
                  extern double PointF3_brown=0;
                  extern double PointF4_silver=0;

                  double COP=0,OP=0,XOP=0;
                  double Start=0,Stop=0,f1g=0,F1R=0,f2g=0,F2R=0,f3g=0,F3R=0 ,f4g=0,F4R=0;

                  int shift = 0,counted_bars=0;

                  //+------------------------------------------------------------------+
                  //| Custom indicator initialization function |
                  //+------------------------------------------------------------------+
                  int init()
                  {

                  return(0);
                  }
                  //+------------------------------------------------------------------+
                  //| Custor indicator deinitialization function |
                  //+------------------------------------------------------------------+
                  int deinit()
                  {
                  //---- TODO: add your code here

                  ObjectDelete("COP Label");
                  ObjectDelete("COP Line");
                  ObjectDelete("OP Label");
                  ObjectDelete("OP Line");
                  ObjectDelete("XOP Label");
                  ObjectDelete("XOP Line");

                  ObjectDelete("Start Label");
                  ObjectDelete("Start Line");
                  ObjectDelete("Stop Label");
                  ObjectDelete("Stop Line");

                  ObjectDelete("f1g Label");
                  ObjectDelete("f1g Line");
                  ObjectDelete("F1R Label");
                  ObjectDelete("F1R Line");
                  ObjectDelete("f2g Label");
                  ObjectDelete("f2g Line");
                  ObjectDelete("F2R Label");
                  ObjectDelete("F2R Line");
                  ObjectDelete("f3g Label");
                  ObjectDelete("f3g Line");
                  ObjectDelete("F3R Label");
                  ObjectDelete("F3R Line");
                  ObjectDelete("f4g Label");
                  ObjectDelete("f4g Line");
                  ObjectDelete("F4R Label");
                  ObjectDelete("F4R Line");

                  //----
                  return(0);
                  }
                  //+------------------------------------------------------------------+
                  //| Custom indicator iteration function |
                  //+------------------------------------------------------------------+
                  int start()
                  {
                  int counted_bars=IndicatorCounted(),CountBars;
                  if (CountBars>=Bars) CountBars=Bars;
                  //SetIndexDrawBegin(0,Bars-CountBars);
                  //SetIndexDrawBegin(1,Bars-CountBars);
                  for (shift=1;shift<=0;shift--) {
                  }

                  //---- Calculate Lines

                  COP = (PointB-PointA)*0.618+PointC;
                  OP = PointB-PointA+PointC;
                  XOP = (PointB-PointA)*1.618+PointC;

                  f1g = PointF-(PointF-PointF1_blue)*0.382;
                  F1R = PointF-(PointF-PointF1_blue)*0.618;
                  f2g = PointF-(PointF-PointF2_pink)*0.382;
                  F2R = PointF-(PointF-PointF2_pink)*0.618;
                  f3g = PointF-(PointF-PointF3_brown)*0.382;
                  F3R = PointF-(PointF-PointF3_brown)*0.618;
                  f4g = PointF-(PointF-PointF4_silver)*0.382;
                  F4R = PointF-(PointF-PointF4_silver)*0.618;

                  //---- Set line labels on chart window
                  {

                  if(ObjectFind("COP Label") != 0)
                  {
                  ObjectCreate("COP Label", OBJ_TEXT, 0, Time[40], COP);
                  ObjectSetText("COP Label", "COP", 11, "Arial", Yellow);
                  }
                  else
                  {
                  ObjectMove("COP Label", 0, Time[40], COP);
                  }

                  if(ObjectFind("OP Label") != 0)
                  {
                  ObjectCreate("OP Label", OBJ_TEXT, 0, Time[40], OP);
                  ObjectSetText("OP Label", " OP", 11, "Arial", Yellow);
                  }
                  else
                  {
                  ObjectMove("OP Label", 0, Time[40], OP);
                  }

                  if(ObjectFind("XOP Label") != 0)
                  {
                  ObjectCreate("XOP Label", OBJ_TEXT, 0, Time[40], XOP);
                  ObjectSetText("XOP Label", "XOP", 11, "Arial", Gold);
                  }
                  else
                  {
                  ObjectMove("XOP Label", 0, Time[40], XOP);
                  }

                  //-------------------------------------------------------------------
                  if(ObjectFind("f1g Label") != 0)
                  {
                  ObjectCreate("f1g Label", OBJ_TEXT, 0, Time[45], f1g);
                  ObjectSetText("f1g Label", " f1g", 11, "Arial", DodgerBlue);
                  }
                  else
                  {
                  ObjectMove("f1g Label", 0, Time[45], f1g);
                  }

                  if(ObjectFind("F1R Label") != 0)
                  {
                  ObjectCreate("F1R Label", OBJ_TEXT, 0, Time[45], F1R);
                  ObjectSetText("F1R Label", " F1R", 11, "Arial", DodgerBlue);
                  }
                  else
                  {
                  ObjectMove("F1R Label", 0, Time[45], F1R);
                  }
                  //---------------------------------------------
                  if(ObjectFind("f2g Label") != 0)
                  {
                  ObjectCreate("f2g Label", OBJ_TEXT, 0, Time[50], f2g);
                  ObjectSetText("f2g Label", " f2g", 11, "Arial", DeepPink);
                  }
                  else
                  {
                  ObjectMove("f2g Label", 0, Time[50], f2g);
                  }

                  if(ObjectFind("F2R Label") != 0)
                  {
                  ObjectCreate("F2R Label", OBJ_TEXT, 0, Time[50], F2R);
                  ObjectSetText("F2R Label", " F2R", 11, "Arial", DeepPink);
                  }
                  else
                  {
                  ObjectMove("F2R Label", 0, Time[50], F2R);
                  }
                  //------------------------------------------------
                  if(ObjectFind("f3g Label") != 0)
                  {
                  ObjectCreate("f3g Label", OBJ_TEXT, 0, Time[55], f3g);
                  ObjectSetText("f3g Label", " f3g", 11, "Arial", Peru);
                  }
                  else
                  {
                  ObjectMove("f3g Label", 0, Time[55], f3g);
                  }

                  if(ObjectFind("F3R Label") != 0)
                  {
                  ObjectCreate("F3R Label", OBJ_TEXT, 0, Time[55], F3R);
                  ObjectSetText("F3R Label", " F3R", 11, "Arial", Peru);
                  }
                  else
                  {
                  ObjectMove("F3R Label", 0, Time[55], F3R);
                  }
                  //----------------------------------------------------------
                  if(ObjectFind("f4g Label") != 0)
                  {
                  ObjectCreate("f4g Label", OBJ_TEXT, 0, Time[60], f4g);
                  ObjectSetText("f4g Label", " f4g", 11, "Arial", Silver);
                  }
                  else
                  {
                  ObjectMove("f4g Label", 0, Time[60], f4g);
                  }

                  if(ObjectFind("F4R Label") != 0)
                  {
                  ObjectCreate("F4R Label", OBJ_TEXT, 0, Time[60], F4R);
                  ObjectSetText("F4R Label", " F4R", 11, "Arial", Silver);
                  }
                  else
                  {
                  ObjectMove("F4R Label", 0, Time[60], F4R);
                  }


                  //--- Draw lines on chart


                  if(ObjectFind("COP Line") != 0)
                  {
                  ObjectCreate("COP Line", OBJ_HLINE, 0, Time[40], COP);
                  ObjectSet("COP Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("COP Line", OBJPROP_COLOR, Yellow);
                  }
                  else
                  {
                  ObjectMove("COP Line", 0, Time[40], COP);
                  }

                  if(ObjectFind("OP Line") != 0)
                  {
                  ObjectCreate("OP Line", OBJ_HLINE, 0, Time[40], OP);
                  ObjectSet("OP Line", OBJPROP_STYLE, STYLE_DASH);
                  ObjectSet("OP Line", OBJPROP_COLOR, Gold);
                  }
                  else
                  {
                  ObjectMove("OP Line", 0, Time[40], OP);
                  }

                  if(ObjectFind("XOP Line") != 0)
                  {
                  ObjectCreate("XOP Line", OBJ_HLINE, 0, Time[40], XOP);
                  ObjectSet("XOP Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("XOP Line", OBJPROP_COLOR, Yellow);
                  }
                  else
                  {
                  ObjectMove("XOP Line", 0, Time[40], XOP);
                  }

                  //----------------------------------------------------------------
                  if(ObjectFind("f1g Line") != 0)
                  {
                  ObjectCreate("f1g Line", OBJ_HLINE, 0, Time[45], f1g);
                  ObjectSet("f1g Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("f1g Line", OBJPROP_COLOR, LawnGreen);
                  }
                  else
                  {
                  ObjectMove("f1g Line", 0, Time[45], f1g);
                  }

                  if(ObjectFind("F1R Line") != 0)
                  {
                  ObjectCreate("F1R Line", OBJ_HLINE, 0, Time[45], F1R);
                  ObjectSet("F1R Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("F1R Line", OBJPROP_COLOR, OrangeRed);
                  }
                  else
                  {
                  ObjectMove("F1R Line", 0, Time[45], F1R);
                  }
                  //----------------------------------------------
                  if(ObjectFind("f2g Line") != 0)
                  {
                  ObjectCreate("f2g Line", OBJ_HLINE, 0, Time[50], f2g);
                  ObjectSet("f2g Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("f2g Line", OBJPROP_COLOR, LawnGreen);
                  }
                  else
                  {
                  ObjectMove("f2g Line", 0, Time[50], f2g);
                  }

                  if(ObjectFind("F2R Line") != 0)
                  {
                  ObjectCreate("F2R Line", OBJ_HLINE, 0, Time[50], F2R);
                  ObjectSet("F2R Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("F2R Line", OBJPROP_COLOR, OrangeRed);
                  }
                  else
                  {
                  ObjectMove("F2R Line", 0, Time[50], F2R);
                  }
                  //-------------------------------------------------
                  if(ObjectFind("f3g Line") != 0)
                  {
                  ObjectCreate("f3g Line", OBJ_HLINE, 0, Time[55], f3g);
                  ObjectSet("f3g Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("f3g Line", OBJPROP_COLOR, LawnGreen);
                  }
                  else
                  {
                  ObjectMove("f3g Line", 0, Time[55], f3g);
                  }

                  if(ObjectFind("F3R Line") != 0)
                  {
                  ObjectCreate("F3R Line", OBJ_HLINE, 0, Time[55], F3R);
                  ObjectSet("F3R Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("F3R Line", OBJPROP_COLOR, OrangeRed);
                  }
                  else
                  {
                  ObjectMove("F3R Line", 0, Time[55], F3R);
                  }
                  //-----------------------------------------------------
                  if(ObjectFind("f4g Line") != 0)
                  {
                  ObjectCreate("f4g Line", OBJ_HLINE, 0, Time[60], f4g);
                  ObjectSet("f4g Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("f4g Line", OBJPROP_COLOR, LawnGreen);
                  }
                  else
                  {
                  ObjectMove("f4g Line", 0, Time[60], f4g);
                  }

                  if(ObjectFind("F4R Line") != 0)
                  {
                  ObjectCreate("F4R Line", OBJ_HLINE, 0, Time[60], F4R);
                  ObjectSet("F4R Line", OBJPROP_STYLE, STYLE_DOT);
                  ObjectSet("F4R Line", OBJPROP_COLOR, OrangeRed);
                  }
                  else
                  {
                  ObjectMove("F4R Line", 0, Time[60], F4R);
                  }
                  //------------------------------------------------------

                  }
                  //---- End of Lines Draw
                  //---- End Of Program
                  return(0);
                  }
                  //+------------------------------------------------------------------+
                  I hope some one understands it all and has the time to help.

                  Comment


                    #24
                    Hey Thrunner,

                    Thanks for teh DEMA code, got it worked out and am now a happy camper.

                    Cheers

                    Comment


                      #25
                      thrunner, there is a DLL in that zip you posted which I believe is against the TOS on this board per the sticky.

                      Comment


                        #26
                        Originally posted by Pete S View Post
                        thrunner, there is a DLL in that zip you posted which I believe is against the TOS on this board per the sticky.
                        You are right, the indicator was mistakenly exported with the wrong switch, all the code are open as shown.

                        Comment


                          #27
                          Modified Moving Average and DiNapoli Stochastic

                          Hi, is any one get the Modified Moving Average (MAV) ? is MAV = Smoothed Moving Average? I find the formula in http://en.wikipedia.org/wiki/Moving_average and DiNapoli book. Still got luck to find the indicator. This MAV is also the base indicator to make DiNapoli Stochastic. This MAV, DiNapoli Stoch & DEMA Macd are very worthy.. Please help. thank you
                          Click image for larger version

Name:	MMA.PNG
Views:	1
Size:	10.8 KB
ID:	853687
                          Last edited by kissaki; 12-09-2009, 11:55 AM.

                          Comment


                            #28
                            All DiNapoli Indicators

                            A couple years ago I wrote all of the DiNapoli indicators for Ninjatrader.

                            I probably stole parts of the code from other places, and perhaps from this thread (I can't remember now). But what I do know is that these indicators:

                            * Are correct, exactly defined according to the book's formulas.
                            * Are updated to work with Ninjatrader 7.
                            * Are not viruses (I wrote them myself; I know they're safe).

                            I have attached them to this message.

                            I still actively trade with these indicators. Hopefully someone else finds them useful too.

                            Don't forget to apply the displaced moving averages (3x3, 7x5, 25x5) as well.

                            Also, if you would like to see a video tutorial I made explaining the concepts behind DiNapoli trading, that's available too (assuming this link isn't broken):

                            http://download.ryansanden.com/static/DinapoliOptions.mp4


                            Hope that helps!

                            Regards,
                            Ryan S.
                            Attached Files

                            Comment


                              #29
                              Good Afternoon Ryan...

                              Do you by any chance still have a copy of that DiNapoli video available??...

                              Thank you,

                              Bob

                              Comment


                                #30
                                Dinapolis Stoch doesn't work under 30 time frame

                                When I use 1 m or 2 m bar, it will just show blank, Can anybody help me? Thank you!

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by mishhh, 05-25-2010, 08:54 AM
                                19 responses
                                6,189 views
                                0 likes
                                Last Post rene69851  
                                Started by gwenael, Today, 09:29 AM
                                0 responses
                                3 views
                                0 likes
                                Last Post gwenael
                                by gwenael
                                 
                                Started by Karado58, 11-26-2012, 02:57 PM
                                8 responses
                                14,829 views
                                0 likes
                                Last Post Option Whisperer  
                                Started by Option Whisperer, Today, 09:05 AM
                                0 responses
                                1 view
                                0 likes
                                Last Post Option Whisperer  
                                Started by cre8able, Yesterday, 01:16 PM
                                3 responses
                                11 views
                                0 likes
                                Last Post cre8able  
                                Working...
                                X