Jump to content

Ocean Theory indis from TSD elite


udc

Recommended Posts

  • Replies 332
  • Created
  • Last Reply

Top Posters In This Topic

monstar: that's strange. Only reason why it wouldn't show anything would be if you attached it to a chart which got less than 40 bars of history. But that's hardly the case (if it was the case you can simply hold "Home" key until it loads more bars and then attach the indi again to the chart).

 

You can also check the "Experts" tab of the "Terminal" window, there may be some error message shown:

 

http://articles.mql4.com/c/articles/2009/02/expert.png

 

 

Anyway, test the indis, guys, as I may make a mistake or overlook something. If there is anything wrong or if it doesn't show exactly the same as the TradeStation version (except the discrepancies due to the different price feed), just shout or something :)

 

Right now I am at 15:38 in the DVD3 video, Pat is explaining the NMS so that will be the next one I guess. It got me a bit angry, though, because NMS uses a linear regression slope function and in TradeStation that's a built-in function, in Metatrader I will have to reprogram it from the scratch.

 

This is my first experience with TradeStation, I never even tried it before, and I must say it's incomparable to Metatrader. Metatrader to TradeStation is like Windows to Unix. It's got modern look and feel, it's intuitive and what not, but inside it's just dull. There are only as many functions and features as necessary whereas TradeStation is loaded. If it wasn't for the Metatrader Server's virtual dealer plug-in it would probably never got spreaded out among all those bucketshops, a.k.a. retail forex brokers/dealers/scammers/whatever-you-call-them, and consequently among the traders. Oh, well..

Link to comment
Share on other sites

monstar: that's strange. Only reason why it wouldn't show anything would be if you attached it to a chart which got less than 40 bars of history. But that's hardly the case (if it was the case you can simply hold "Home" key until it loads more bars and then attach the indi again to the chart).

 

You can also check the "Experts" tab of the "Terminal" window, there may be some error message shown:

 

http://articles.mql4.com/c/articles/2009/02/expert.png

 

 

Anyway, test the indis, guys, as I may make a mistake or overlook something. If there is anything wrong or if it doesn't show exactly the same as the TradeStation version (except the discrepancies due to the different price feed), just shout or something :)

 

Right now I am at 15:38 in the DVD3 video, Pat is explaining the NMS so that will be the next one I guess. It got me a bit angry, though, because NMS uses a linear regression slope function and in TradeStation that's a built-in function, in Metatrader I will have to reprogram it from the scratch.

 

This is my first experience with TradeStation, I never even tried it before, and I must say it's incomparable to Metatrader. Metatrader to TradeStation is like Windows to Unix. It's got modern look and feel, it's intuitive and what not, but inside it's just dull. There are only as many functions and features as necessary whereas TradeStation is loaded. If it wasn't for the Metatrader Server's virtual dealer plug-in it would probably never got spreaded out among all those bucketshops, a.k.a. retail forex brokers/dealers/scammers/whatever-you-call-them, and consequently among the traders. Oh, well..

 

Keep up udc!, thanks again.. Weldone!

Edited by tgt123
Link to comment
Share on other sites

UDC, does this pack of indicators include Ocean Pro indicators? E.g: the Triple STX with Shadow stop indicators (and much more), the Component 4-line, the STX #7 cycle tool, and the indispensable BTX 2-line (directional) and BTX 1-line (non-directional) trend indicators. Thanks
Link to comment
Share on other sites

Grain Trader: not sure which ones you mean. In some of earlier posts I described what Ocean indis are in the TradeStation package I shared here.

 

hi Udc, the original ocean software consisted of

The Ocean Classic indicators include the NMA and the Fast NMA, the NST, NDX and NXC bounded tools, the NMC and NMC2 zero-hit indicators and the NMS "structure" tool

these are the original ocean classic indicators, what I wanted to know is if you have

 

The Ocean Pro indicators include the Triple STX with Shadow stop indicators (and much more), the Component 4-line, the STX #7 cycle tool, and the indispensable BTX 2-line (directional) and BTX 1-line

 

which is basically the stx and the btx

 

If you have them for tradestation I would appreciate it

Link to comment
Share on other sites

Well, the the package I posted here does include "Ocean Plus Indicator Package" which contains "BTX_1Line w SD", "BTX_2Line w SD" and "STX" studies and supporting functions. Whether these BTX and STX are what you are referring to or they are some "lesser" versions, I don't know. Anyway, the logic in these is moved to the external DLL which is PC-Guard 5.0 protected. That means that the actual algorithm may be hard to get, but it still could be possible to get those on the Metatrader platform.
Link to comment
Share on other sites

hxxp://www.forex-tsd.c0m/indicators-metatrader-4/10951-ocean-theory.html

hxxp://www.forex-tsd.c0m/questions/8182-ocean-indicators.html

hxxp://www.forex-tsd.c0m/indicators-metatrader-4/12671-need-better-moving-average-try-nma.html

 

interesting ocean theory project ...happy

 

notes: downloadable indicators from http://www.forex-tsd.com/indicators-metatrader-4/12671-need-better-moving-average-try-nma.html

 

nma20.mq4

nmr.mq4

NMA20_mtf.mq4

NMR20_mtf.mq4

nma-smooth.mq4

Edited by edmun1388
Link to comment
Share on other sites

Can someone put all the indicator in rar file? Just in case that I or other member missed some indicator.

 

Hi UDC, I have compiled your indicators so far into an archive.

 

http://uloz.to/xLQBJCJ/ocean-indicators-by-udc-v1-zip

 

Maybe some decompile expert here can help you with DLL for ocean BTX/STX indicator :)

 

Thanks for your hard work so far.

Link to comment
Share on other sites

Hi UDC,

 

thanks for the great work. Does anyone have the NMC (natural market combo) indicator? it is a combination of natural market river (NMR) and natural market mirror (NMM) which are 2 of the ocean series indicators. If anyone has access to forex-tsd advanced elite section please download and post here.

 

Thanks

Fawaz

Link to comment
Share on other sites

NMS for MT4

 

NMS.

 

It's slowly getting more interesting.

 

 

Original NMS on TradeStation:

http://img29.imageshack.us/img29/3972/nmstradestation.png

 

NMS on Metatrader:

http://img525.imageshack.us/img525/6312/nmsmetatrader.png

 

Original size screenshots:

http://img526.imageshack.us/img526/3972/nmstradestation.png

http://img585.imageshack.us/img585/6312/nmsmetatrader.png

 

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Silver
#property indicator_level1 0
#property indicator_levelcolor Gray
#property indicator_levelstyle 2

extern int     NMS_period  = 40;
extern bool    Show_SD     = true;
extern int     SD_len      = 30;
extern double  SD_up       = 2;
extern double  SD_dn       = 2;

double NMS[];
double SD[];

int init()
{
 string nmsname = "NMS(" + NMS_period + ")";
 string sdname = "NMS_SD(" + SD_len + ")";
 IndicatorShortName(nmsname);
 IndicatorBuffers(2);
 SetIndexBuffer(0, NMS);
 SetIndexLabel(0, nmsname);
 SetIndexBuffer(1, SD);
 SetIndexLabel(1, sdname);
 return(0);
}

int start()
{
 int limit, i, ii, counted_bars = IndicatorCounted();

 if(Bars <= NMS_period) return(0);
 if(counted_bars < 0) counted_bars = 0;
 if(counted_bars > NMS_period) limit = Bars - counted_bars;
 else                          limit = Bars - NMS_period - 1;

 for(i = limit; i >= 0; i--)
   {
   double nms2 = 0;
   for(ii = 1; ii <= NMS_period; ii++)
     {
     double oLRSlope = 0, SumXY = 0, SumY = 0, SumX, SumXSqr, Divisor;
     if(ii > 1)
       {
       SumX = ii * (ii - 1) * 0.5;
       SumXSqr = ii * (ii - 1) * (2 * ii - 1) * 1/6;
       Divisor = (SumX * SumX) - ii * SumXSqr;
       for(int iii = 0; iii < ii; iii++)
         {
         SumXY += iii * MathLog(Close[i+iii]);
         SumY += MathLog(Close[i+iii]);
         }
       oLRSlope = (ii * SumXY - SumX * SumY) / Divisor;
       }
     nms2 += oLRSlope * MathSqrt(ii);
     }
   NMS[i] = nms2 * 100;
   }

 if(Show_SD)
   for(i = limit; i >= 0; i--)
     if(i < Bars - NMS_period - 1 - SD_len)
       {
       if(NMS[i] == 0)     SD[i] = 0;
       else if(NMS[i] > 0) SD[i] = iBandsOnArray(NMS, 0, SD_len, SD_up, 0, MODE_UPPER, i);
       else if(NMS[i] < 0) SD[i] = iBandsOnArray(NMS, 0, SD_len, SD_dn, 0, MODE_LOWER, i);
       }

 return(0);
}

 

The source code is also available for download here:

http://pastebin.com/Ct55hgr7

 

 

fawaz79: I will get to NMC too, just patience.

Link to comment
Share on other sites

NMS_with_Ocn_MAs for MT4

 

NMS_with_Ocn_MAs.

 

There is again a bug in the TradeStation source code regarding the FastNMA's lookback calculation. Actually it's in all source codes where NMA & FastNMA are applied onto another Ocean indi.

 

Wherever you see a line like this:

Value3 = _Ocn.FastMA.Fn (FALSE, Value1, CLOSE, SC, 1, 1, LB.Min) ;

 

the third parameter of _Ocn.FastMA.Fn must be identical to the second parameter, so it must be like this:

Value3 = _Ocn.FastMA.Fn (FALSE, Value1, Value1, SC, 1, 1, LB.Min) ;

 

 

Original NMS_with_Ocn_MAs on TradeStation:

http://img208.imageshack.us/img208/7532/nmswithocnmastradestati.png

 

NMS_with_Ocn_MAs on Metatrader:

http://img140.imageshack.us/img140/6875/nmswithocnmasmetatrader.png

 

Original size screenshots:

http://img38.imageshack.us/img38/7532/nmswithocnmastradestati.png

http://img525.imageshack.us/img525/6875/nmswithocnmasmetatrader.png

 

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Magenta
#property indicator_color2 Yellow
#property indicator_color3 Aqua
#property indicator_level1 0
#property indicator_levelcolor Gray
#property indicator_levelstyle 2

extern int     NMS_period  = 40;
extern int     NMA_period  = 40;
extern int     NMA_LB_min  = 8;

double NMS[];
double NMS_NMA[];
double NMS_FastNMA[];

int init()
{
 IndicatorShortName("NMS_with_Ocn_MAs(" + NMS_period + ", " + NMA_period + ", " + NMA_LB_min + ")");
 IndicatorBuffers(3);
 SetIndexBuffer(0, NMS);
 SetIndexLabel(0, "NMS(" + NMS_period + ")");
 SetIndexBuffer(1, NMS_NMA);
 SetIndexLabel(1, "NMS_NMA(" + NMA_period + ")");
 SetIndexBuffer(2, NMS_FastNMA);
 SetIndexLabel(2, "NMS_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")");
 return(0);
}

int start()
{
 int limit, i, ii, counted_bars = IndicatorCounted();
 double nms2, sum, abssum, ratio, nmsnum, maxnms;

 if(Bars <= NMS_period) return(0);
 if(counted_bars < 0) counted_bars = 0;
 if(counted_bars > NMS_period) limit = Bars - counted_bars;
 else                          limit = Bars - NMS_period - 1;

 for(i = limit; i >= 0; i--)
   {
   nms2 = 0;
   for(ii = 1; ii <= NMS_period; ii++)
     {
     double oLRSlope = 0, SumXY = 0, SumY = 0, SumX, SumXSqr, Divisor;
     if(ii > 1)
       {
       SumX = ii * (ii - 1) * 0.5;
       SumXSqr = ii * (ii - 1) * (2 * ii - 1) * 1/6;
       Divisor = (SumX * SumX) - ii * SumXSqr;
       for(int iii = 0; iii < ii; iii++)
         {
         SumXY += iii * MathLog(Close[i+iii]);
         SumY += MathLog(Close[i+iii]);
         }
       oLRSlope = (ii * SumXY - SumX * SumY) / Divisor;
       }
     nms2 += oLRSlope * MathSqrt(ii);
     }
   NMS[i] = nms2 * 100;
   }

 for(i = limit; i >= 0; i--)
   if(i < Bars - NMS_period - 1 - NMA_period)
     {
     ratio = 0;
     sum = (NMS[i] - NMS[i+1]) + (NMS[i+1] - NMS[i+2]) * (MathSqrt(2)-1);
     for(ii = 2; ii < NMA_period; ii++)
       sum += (NMS[i+ii] - NMS[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii));
     abssum = MathAbs(sum);
     sum = 0;
     for(ii = 0; ii < NMA_period; ii++)
       sum += MathAbs(NMS[i+ii] - NMS[i+ii+1]);
     if(sum != 0) ratio = abssum / sum;
     NMS_NMA[i] = NMS_NMA[i+1] + (NMS[i] - NMS_NMA[i+1]) * ratio;
     }

 for(i = limit; i >= 0; i--)
   if(i < Bars - NMS_period - 1 - NMA_period)
     {
     maxnms = 0; ratio = 0;
     int NMA_LB_max;
     for(ii = 1; ii <= NMA_period; ii++)
       {
       nmsnum = (NMS[i] - NMS[i+ii]) / MathSqrt(ii);
       if(MathAbs(nmsnum) > maxnms) { maxnms = MathAbs(nmsnum); NMA_LB_max = ii; }
       }
     if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min;
     sum = (NMS[i] - NMS[i+1]) + (NMS[i+1] - NMS[i+2]) * (MathSqrt(2)-1);
     for(ii = 2; ii < NMA_LB_max; ii++)
       sum += (NMS[i+ii] - NMS[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii));
     abssum = MathAbs(sum);
     sum = 0;
     for(ii = 0; ii < NMA_LB_max; ii++)
       sum += MathAbs(NMS[i+ii] - NMS[i+ii+1]);
     if(sum != 0) ratio = abssum / sum;
     NMS_FastNMA[i] = NMS_FastNMA[i+1] + (NMS[i] - NMS_FastNMA[i+1]) * ratio;
     }

 return(0);
}

 

The source code is also available for download here:

http://pastebin.com/eEqjBy7C

Link to comment
Share on other sites

NMM_MACD for MT4

 

This one is NMM_MACD. First it calculates NMM, then it calculates NMA of it (like in NMM_with_Ocn_MAs), but what is actually drawn on the chart is the difference between those two, i.e. NMM-NMA.

 

 

Original NMM_MACD on TradeStation:

http://img585.imageshack.us/img585/1374/nmmmacdtradestation.png

 

NMM_MACD on Metatrader:

http://img844.imageshack.us/img844/7105/nmmmacdmetatrader.png

 

Original size screenshots:

http://img834.imageshack.us/img834/1374/nmmmacdtradestation.png

http://img191.imageshack.us/img191/7105/nmmmacdmetatrader.png

 

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Silver
#property indicator_level1 0
#property indicator_levelcolor Gray
#property indicator_levelstyle 2

extern int     NMM_MACD_period  = 40;
extern bool    Show_SD          = true;
extern int     SD_len           = 30;
extern double  SD_up            = 2;
extern double  SD_dn            = 2;

double NMM_MACD[];
double SD[];
double NMM[];
double NMM_MA[];

int init()
{
 string nmmmacdname = "NMM_MACD(" + NMM_MACD_period + ")";
 string sdname = "NMM_MACD_SD(" + SD_len + ")";
 IndicatorShortName(nmmmacdname);
 IndicatorBuffers(4);
 SetIndexBuffer(0, NMM_MACD);
 SetIndexLabel(0, nmmmacdname);
 SetIndexBuffer(1, SD);
 SetIndexLabel(1, sdname);
 SetIndexBuffer(2, NMM);
 SetIndexBuffer(3, NMM_MA);
 return(0);
}

int start()
{
 int limit, i, ii, counted_bars = IndicatorCounted();
 double nmm2, sum, abssum, ratio;

 if(Bars <= 2*NMM_MACD_period) return(0);
 if(counted_bars < 0) counted_bars = 0;
 if(counted_bars > NMM_MACD_period) limit = Bars - counted_bars;
 else                               limit = Bars - NMM_MACD_period - 1;

 for(i = limit; i >= 0; i--)
   {
   nmm2 = 0;
   for(ii = 1; ii <= NMM_MACD_period; ii++)
     nmm2 += (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii);
   NMM[i] = (nmm2 / NMM_MACD_period)  * 1000;
   }

 for(i = limit; i >= 0; i--)
   if(i < Bars - 2*NMM_MACD_period - 1)
     {
     ratio = 0;
     sum = (NMM[i] - NMM[i+1]) + (NMM[i+1] - NMM[i+2]) * (MathSqrt(2)-1);
     for(ii = 2; ii < NMM_MACD_period; ii++)
       sum += (NMM[i+ii] - NMM[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii));
     abssum = MathAbs(sum);
     sum = 0;
     for(ii = 0; ii < NMM_MACD_period; ii++)
       sum += MathAbs(NMM[i+ii] - NMM[i+ii+1]);
     if(sum != 0) ratio = abssum / sum;
     NMM_MA[i] = NMM_MA[i+1] + (NMM[i] - NMM_MA[i+1]) * ratio;
     NMM_MACD[i] = NMM[i] - NMM_MA[i];
     }

 if(Show_SD)
   for(i = limit; i >= 0; i--)
     if(i < Bars - 2*NMM_MACD_period - 1 - SD_len)
       {
       if(NMM_MACD[i] == 0)     SD[i] = 0;
       else if(NMM_MACD[i] > 0) SD[i] = iBandsOnArray(NMM_MACD, 0, SD_len, SD_up, 0, MODE_UPPER, i);
       else if(NMM_MACD[i] < 0) SD[i] = iBandsOnArray(NMM_MACD, 0, SD_len, SD_dn, 0, MODE_LOWER, i);
       }

 return(0);
}

 

The source code is also available for download here:

http://pastebin.com/JczHEshB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...