Jump to content

for-ex

Members
  • Posts

    76
  • Joined

  • Last visited

Reputation Activity

  1. Like
    for-ex got a reaction from airplus in Currency Meter V5 Modified Version   
    This was modified by friend of mine..im not using this but probably anyone here might be interested.. :D
    Please be reminded that you should have the original currency meter v5 indicators..then just write existing file (make sure you have back-up) 8-)
    Then all you guys need to do is just load the template provided.. :)
     
    The link:
    http://www.mediafire.com/file/mmmrmiznn5r/CMV5 Modified Version.rar
     
    Enjoys and hapy trading :D :D
     
    Dont forget to kudos
     
    p/s sharing is caring to the death =))
  2. Like
    for-ex got a reaction from fxeasy5 in EWB EASY Trading System   
    Orait this is the among indicators that i personally used for now..it came from Dean Malone ideas and was modified by his friend.. :)
    Well as you know Dean Malone was the creator of Traders Dynamic Index indicators.. ;)
    This system has high accuracy IF you follow the rules.. :D
    Using this system..im using time frame for M15 and H1 ;)) ;))
     
    Manual is included :D :D
     
    The link: http://www.mediafire.com/file/3zmznbjui1q/EWB_EASY_T_S.rar
     
    So enjoys and dont forget to kudos me ;))
  3. Like
    for-ex reacted to Bill Bundle in Forex Tool Shop   
    Free Indicators
    http://forextoolshop.com/manual-systems/free-indicators
    Free Expert Advisors
    http://forextoolshop.com/automated-systems-forex/free-expert-advisors
  4. Like
    for-ex reacted to daretolive in [FREE]Oei Hartono - Number Trade   
    For-ex, we had the same issue with depositfiles but now it's available again. Anyway here's another link. Sorry for delay, was away.
     

    http://www.multiupload.nl/B8Z2N2WC2G
  5. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    BTX for MT4
     
    Behold the magnificent BTX on Metatrader :)
     
    And since we have the luxury of JMA which is faster and smoother with less overshooting, you can of course choose JMA instead of the default TEMA.
     
    Original BTX on TradeStation:
    http://img688.imageshack.us/img688/4426/btxtradestation.png
     
    Ocn_BTXx on Metatrader:
    http://img841.imageshack.us/img841/3442/btxmetatrader.png
     
    Original size screenshots:
    http://img338.imageshack.us/img338/4426/btxtradestation.png
    http://img85.imageshack.us/img85/3442/btxmetatrader.png
     
     

    // Ocn_BTXx version 1.0 #property copyright "© jim sloman, jma © mark jurik, for metatrader reprogrammed by udc" #property link "[email protected]" #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 Magenta #property indicator_color2 Silver #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_level1 35 #property indicator_levelcolor Gray #property indicator_levelstyle 2 #property indicator_minimum 0 #property indicator_maximum 100 extern int BTX_period = 40; extern int SmLen = 20; extern bool Use_JMA_instead_TEMA = false; extern double JMA_Length = 10; extern int JMA_Phase = 50; extern int MaxBars = 0; extern bool Show_SD = true; extern int SD_len = 20; extern double SD_up = 1.5; extern double SD_dn = 1.5; extern bool Show_SD_up = true; extern bool Show_SD_dn = true; extern bool Show_SD_md = true; double BTX[]; double SD[]; double SD2[]; double SD3[]; double RawBTX[]; double maBTX[]; double fC0Buffer[]; double fA8Buffer[]; double fC8Buffer[]; double list[128], ring1[128], ring2[11], buffer[62]; bool initFlag; int limitValue, startValue, loopParam, loopCriteria; int cycleLimit, highLimit, counterA, counterB; double cycleDelta, lowDValue, highDValue, absValue, paramA, paramB; double phaseParam, logParam, JMAValue, series, sValue, sqrtParam, lengthDivider; int s58, s60, s40, s38, s68; bool initialized; #import "OBP1Lock32x.dll" bool LTInitializeFromInix(string); double LTCalcValx(string, double, double, double, double, string); #define dll "OBP1Lock32.dll" #import double arr6[99], arr7[99], arr8[99], arr9[99], arr10[99], arr11[99]; int init() { initialized = LTInitializeFromInix(dll); if(!initialized) return(0); if(SmLen < 1) SmLen = 1; if(BTX_period > 98) BTX_period = 98; string btxname = "BTX(" + BTX_period + ", " + SmLen + ")"; if(Use_JMA_instead_TEMA) btxname = "BTX_JMA(" + BTX_period + ", " + JMA_Length + ", " + JMA_Phase + ")"; IndicatorShortName(btxname); IndicatorDigits(2); IndicatorBuffers(6); SetIndexBuffer(0, BTX); SetIndexLabel(0, btxname); SetIndexBuffer(1, SD); SetIndexBuffer(2, SD2); SetIndexBuffer(3, SD3); if(Show_SD_up) SetIndexLabel(1, "BTX_SD_up(" + SD_len + ")"); else SetIndexLabel(1, "unused"); if(Show_SD_dn) SetIndexLabel(2, "BTX_SD_dn(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_md) SetIndexLabel(3, "BTX_SD_md(" + SD_len + ")"); else SetIndexLabel(3, "unused"); SetIndexBuffer(4, RawBTX); SetIndexBuffer(5, maBTX); ArraySetAsSeries(arr6, true); ArraySetAsSeries(arr7, true); ArraySetAsSeries(arr8, true); ArraySetAsSeries(arr9, true); ArraySetAsSeries(arr10, true); ArraySetAsSeries(arr11, true); return(0); } int start() { if(!initialized) return(0); int limit, i, ii, counted_bars = IndicatorCounted()-1, bars; if(MaxBars > 0) { bars = MaxBars; if(counted_bars > bars) counted_bars = bars - 2; } else bars = Bars; if(Use_JMA_instead_TEMA) { if(bars <= BTX_period + JMA_Length) return(0); } else { if(bars <= BTX_period + 3*SmLen) return(0); } if(counted_bars < 0) counted_bars = 0; if(counted_bars > BTX_period) limit = bars - counted_bars; else limit = bars - BTX_period - 1; for(i = limit; i >= 0; i--) { double var2 = 0, var3 = 0; ArrayInitialize(arr6, 0); ArrayInitialize(arr7, 0); ArrayInitialize(arr8, 0); ArrayInitialize(arr9, 0); ArrayInitialize(arr10, 0); ArrayInitialize(arr11, 0); arr6[0] = LTCalcValx(dll, Close[i], 0.5, High[i], Low[i], "eBBcmGJhfe"); for(ii = 1; ii <= BTX_period; ii++) { arr6[ii] = LTCalcValx(dll, Close[i+ii], Close[i+ii-1], 0.5, Close[i], "FpmqUGJh"); arr7[ii] = LTCalcValx(dll, arr6[ii-1], arr6[ii], Close[i], 0.5, "rmEsGMDfF"); arr8[ii] = LTCalcValx(dll, arr8[ii-1], (arr7[ii]), arr8[ii], arr7[ii-1], "smUDecGMJYh"); if(arr8[ii] == 0) arr9[ii] = 0; else arr9[ii] = LTCalcValx(dll, arr6[0], arr6[ii], arr8[ii], arr7[ii], "rUGMecDJYBBXU"); arr10[ii] = 1 / LTCalcValx(dll, 0.5, ii, arr9[ii], -MathAbs(arr9[ii-1]), "UhWGceMBBJn"); arr11[ii] = LTCalcValx(dll, arr9[ii], arr10[ii], arr9[ii-1], arr8[ii], "F3ecmGBBMqec"); var2 = LTCalcValx(dll, var2, arr11[ii], arr11[ii], var2, "ceGMhftTds"); var3 = LTCalcValx(dll, var3, arr10[ii], var2, var3, "jTGceMBBh"); } RawBTX[i] = LTCalcValx(dll, var2, var3, 100, 0.5, "mUDF0AA8GMUXBBq"); } if(!Use_JMA_instead_TEMA) { double ExpSmooth = 2, XAvg1, XAvg2, XAvg3; ExpSmooth = ExpSmooth / (SmLen + 1); for(i = bars - BTX_period - 1; i >= 0; i--) { XAvg1 += ExpSmooth * (RawBTX[i] - XAvg1); XAvg2 += ExpSmooth * (XAvg1 - XAvg2); XAvg3 += ExpSmooth * (XAvg2 - XAvg3); maBTX[i] = 3 * XAvg1 - 3 * XAvg2 + XAvg3; if(i < bars - BTX_period - 1 - 3*SmLen) BTX[i] = NormalizeDouble(maBTX[i], 2); } } else { ArrayResize(fC0Buffer, bars - BTX_period); ArraySetAsSeries(fC0Buffer, true); ArrayInitialize(fC0Buffer, 0); ArrayResize(fA8Buffer, bars - BTX_period); ArraySetAsSeries(fA8Buffer, true); ArrayInitialize(fA8Buffer, 0); ArrayResize(fC8Buffer, bars - BTX_period); ArraySetAsSeries(fC8Buffer, true); ArrayInitialize(fC8Buffer, 0); ArrayInitialize(list, 0); initFlag = false; limitValue = 0; startValue = 0; loopParam = 0; loopCriteria = 0; cycleLimit = 0; highLimit = 0; counterA = 0; counterB = 0; cycleDelta = 0; lowDValue = 0; highDValue = 0; absValue = 0; paramA = 0; paramB = 0; phaseParam = 0; logParam = 0; JMAValue = 0; series = 0; sValue = 0; sqrtParam = 0; lengthDivider = 0; s58 = 0; s60 = 0; s40 = 0; s38 = 0; s68 = 0; ArrayInitialize(ring2, 0); ArrayInitialize(ring1, 0); ArrayInitialize(buffer, 0); double lengthParam; limitValue = 63; startValue = 64; for(i = 0; i <= limitValue; i++) list[i] = -1000000; for(i = startValue; i <= 127; i++) list[i] = 1000000; initFlag = true; if(JMA_Length < 1.0000000002) lengthParam = 0.0000000001; else lengthParam = (JMA_Length - 1) / 2.0; if(JMA_Phase < -100) phaseParam = 0.5; else if(JMA_Phase > 100) phaseParam = 2.5; else phaseParam = JMA_Phase / 100.0 + 1.5; logParam = MathLog(MathSqrt(lengthParam)) / MathLog(2.0); if(logParam + 2.0 < 0) logParam = 0; else logParam = logParam + 2.0; sqrtParam = MathSqrt(lengthParam) * logParam; lengthParam = lengthParam * 0.9; lengthDivider = lengthParam / (lengthParam + 2.0); for(i = bars - BTX_period - 1; i >= 0; i--) { jma(RawBTX, maBTX, i); if(i < bars - BTX_period - 1 - JMA_Length) BTX[i] = NormalizeDouble(maBTX[i], 2); } } int limitx; if(!Use_JMA_instead_TEMA) limitx = bars - BTX_period - 1 - 3*SmLen; else limitx = bars - BTX_period - 1 - JMA_Length; if(Show_SD) for(i = limit; i >= 0; i--) if(i < limitx - SD_len) { if(Show_SD_up) SD[i] = iBandsOnArray(BTX, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_dn) SD2[i] = iBandsOnArray(BTX, 0, SD_len, SD_dn, 0, MODE_LOWER, i); if(Show_SD_md) SD3[i] = (iBandsOnArray(BTX, 0, SD_len, SD_up, 0, MODE_UPPER, i)+ iBandsOnArray(BTX, 0, SD_len, SD_dn, 0, MODE_LOWER, i)) / 2; } return(0); } double jma(double& input[], double& output[], int shift) { series = input[shift]; if(loopParam < 61) { loopParam++; buffer[loopParam] = series; } if(loopParam > 30) { if(initFlag) { initFlag = false; int diffFlag = 0; for(int i = 1; i <= 29; i++) if(buffer[i + 1] != buffer[i]) diffFlag = 1; highLimit = diffFlag * 30; if(highLimit == 0) paramB = series; else paramB = buffer[1]; paramA = paramB; if(highLimit > 29) highLimit = 29; } else highLimit = 0; for(i = highLimit; i >= 0; i--) { if(i == 0) sValue = series; else sValue = buffer [31 - i]; if(MathAbs(sValue - paramA) > MathAbs(sValue - paramB)) absValue = MathAbs(sValue - paramA); else absValue = MathAbs(sValue - paramB); double dValue = absValue + 0.0000000001; if(counterA <= 1) counterA = 127; else counterA--; if(counterB <= 1) counterB = 10; else counterB--; if(cycleLimit < 128) cycleLimit++; cycleDelta += (dValue - ring2[counterB]); ring2[counterB] = dValue; if(cycleLimit > 10) highDValue = cycleDelta / 10.0; else highDValue = cycleDelta / cycleLimit; if(cycleLimit > 127) { dValue = ring1[counterA]; ring1[counterA] = highDValue; s68 = 64; s58 = s68; while(s68 > 1) { if(list[s58] < dValue) { s68 = s68 / 2.0; s58 += s68; } else if(list[s58] == dValue) s68 = 1; else { s68 = s68 / 2.0; s58 -= s68; } } } else { ring1[counterA] = highDValue; if((limitValue + startValue) > 127) { startValue--; s58 = startValue; } else { limitValue++; s58 = limitValue; } if(limitValue > 96) s38 = 96; else s38 = limitValue; if(startValue < 32) s40 = 32; else s40 = startValue; } s68 = 64; s60 = s68; while(s68 > 1) { if(list[s60] >= highDValue) { if(list[s60 - 1] <= highDValue) s68 = 1; else { s68 = s68 / 2.0; s60 -= s68; } } else { s68 = s68 / 2.0; s60 += s68; } if((s60 == 127) && (highDValue > list[127])) s60 = 128; } if(cycleLimit > 127) { if(s58 >= s60) { if(((s38 + 1) > s60) && ((s40 - 1) < s60)) lowDValue += highDValue; else if((s40 > s60) && ((s40 - 1) < s58)) lowDValue += list[s40 - 1]; } else if(s40 >= s60) { if(((s38 + 1) < s60) && ((s38 + 1) > s58)) lowDValue += list[s38 + 1]; } else if((s38 + 2) > s60) lowDValue += highDValue; else if(((s38 + 1) < s60) && ((s38 + 1) > s58)) lowDValue += list[s38 + 1]; if(s58 > s60) { if(((s40 - 1) < s58) && ((s38 + 1) > s58)) lowDValue -= list[s58]; else if((s38 < s58) && ((s38 + 1) > s60)) lowDValue -= list[s38]; } else { if(((s38 + 1) > s58) && ((s40 - 1) < s58)) lowDValue -= list[s58]; else if((s40 > s58) && (s40 < s60)) lowDValue -= list[s40]; } } if(s58 <= s60) { if(s58 >= s60) list[s60] = highDValue; else { for(int j = s58 + 1; j <= (s60 - 1); j++) list[j - 1] = list[j]; list[s60 - 1] = highDValue; } } else { for(j = s58 - 1; j >= s60; j--) list[j + 1] = list[j]; list[s60] = highDValue; } if(cycleLimit <= 127) { lowDValue = 0; for(j = s40; j <= s38; j++) lowDValue += list[j]; } if((loopCriteria + 1) > 31) loopCriteria = 31; else loopCriteria++; double JMATempValue, sqrtDivider = sqrtParam / (sqrtParam + 1.0); if(loopCriteria <= 30) { if(sValue - paramA > 0) paramA = sValue; else paramA = sValue - (sValue - paramA) * sqrtDivider; if(sValue - paramB < 0) paramB = sValue; else paramB = sValue - (sValue - paramB) * sqrtDivider; JMATempValue = series; if(loopCriteria == 30) { fC0Buffer[shift] = series; int intPart; if(MathCeil(sqrtParam) >= 1) intPart = MathCeil(sqrtParam); else intPart = 1; int leftInt = IntPortion(intPart); if(MathFloor(sqrtParam) >= 1) intPart = MathFloor(sqrtParam); else intPart = 1; int rightPart = IntPortion (intPart); if(leftInt == rightPart) dValue = 1.0; else dValue = (sqrtParam - rightPart) / (leftInt - rightPart); if(rightPart <= 29) int upShift = rightPart; else upShift = 29; if(leftInt <= 29) int dnShift = leftInt; else dnShift = 29; fA8Buffer[shift] = (series - buffer[loopParam - upShift]) * (1 - dValue) / rightPart + (series - buffer[loopParam - dnShift]) * dValue / leftInt; } } else { double powerValue, squareValue; dValue = lowDValue / (s38 - s40 + 1); if(0.5 <= logParam - 2.0) powerValue = logParam - 2.0; else powerValue = 0.5; if(logParam >= MathPow(absValue/dValue, powerValue)) dValue = MathPow(absValue/dValue, powerValue); else dValue = logParam; if(dValue < 1) dValue = 1; powerValue = MathPow(sqrtDivider, MathSqrt (dValue)); if(sValue - paramA > 0) paramA = sValue; else paramA = sValue - (sValue - paramA) * powerValue; if(sValue - paramB < 0) paramB = sValue; else paramB = sValue - (sValue - paramB) * powerValue; } } if(loopCriteria > 30) { JMATempValue = output[shift + 1]; powerValue = MathPow(lengthDivider, dValue); squareValue = MathPow(powerValue, 2); fC0Buffer[shift] = (1 - powerValue) * series + powerValue * fC0Buffer[shift + 1]; fC8Buffer[shift] = (series - fC0Buffer[shift]) * (1 - lengthDivider) + lengthDivider * fC8Buffer[shift + 1]; fA8Buffer[shift] = (phaseParam * fC8Buffer[shift] + fC0Buffer[shift] - JMATempValue) * (powerValue * (-2.0) + squareValue + 1) + squareValue * fA8Buffer[shift + 1]; JMATempValue += fA8Buffer[shift]; } JMAValue = JMATempValue; } if(loopParam <= 30) JMAValue = 0; output[shift] = JMAValue; } int IntPortion(double param) { if (param > 0) return (MathFloor (param)); if (param < 0) return (MathCeil (param)); return (0); }
     
    The source code is also available for download here:
    http://pastebin.com/xdiirCT1
     
     
    So yeah, it took me a white. I wasted most of the time digging deep into RE assuming that the DLL was just so well protected while in fact the problem was in Metatrader the whole time. As it turned out the DLL is quite dull, definitely not what the authors (http://www.investlabs.com/diamondlock2000.html) are trying to pull. Metatrader just can't work with it directly, though. Before I realized that I even programmed float data type emulation because the DLL is using float and Metatrader doesn't have it at all (if you need it for anything suit yourself: http://pastebin.com/EwmAM8jD). So I ended up programming a wrapper - a tiny DLL that Metatrader is capable to talk with and which on the other hand is capable to talk with the Ocean DLL. I actually made it a bit universal so when you call the wrapper the first parameter is the name of the target DLL so it may work even for other Tradestation indicators using the Diamond Lock DLL, if someone chooses to port them into Metatrader.
     
     
    Now the instructions:

    install Ocean Plus package and keygen it
    use OBP1Lock32test.exe to verify the installation - it should give you this result:
    C:\Documents and Settings\Administrator\Desktop>OBP1Lock32test.exe flag: 1 result: 0.693147

    copy OBP1Lock32x.dll either into Metatrader folder experts\libraries or where OBP1Lock32.dll is installed (C:\WINDOWS\system) or anywhere in the system path as you please
    use the .mq4 code as usual

     
    The Ocean Plus package can be found here:
    http://uloz.to/xk2fMRJ/ocean-plus-indicator-package-manual-for-ts-7z
     
    Both OBP1Lock32test.exe and OBP1Lock32x.dll can be found here (mirror it, please, in case I die or something :) ):
    http://uloz.to/xKFrnBk/obp1lock32x-7z
     
     
    Now what remains is 2-line BTX and then STX. Also, I've got an idea to make a simple oscilator FastNMA compared to NMA. It may be useful for those who are interested in FastNMA vs NMA crossovers. And of course the divergence implementation for fawaz79 (a bit more patience, please).
  6. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    BTX_2line for MT4
     
    Here goes Ocn_BTX_2linex, as usual with optional JMA.
     
    Also a new version of Ocn_BTXx with optional "BTX_2line_based_colors" switch which makes BTX to be drawn in green/red color based on relative positions of BTX_2line's BTXp and BTXn.
     
    Original BTX_2line on TradeStation:
    http://img821.imageshack.us/img821/7572/btx2linetradestation.png
     
    Ocn_BTX_2linex (and Ocn_BTXx in colors) on Metatrader:
    http://img13.imageshack.us/img13/5236/btx2linemetatrader.png
     
    Original size screenshots:
    http://img806.imageshack.us/img806/7572/btx2linetradestation.png
    http://img210.imageshack.us/img210/5236/btx2linemetatrader.png
     
     
    Ocn_BTX_2linex:
    http://pastebin.com/eF1Ek6Ld
     
     
    Ocn_BTXx:
    http://pastebin.com/mhVwMsNM
     
     
    These DLL calculations are rather CPU consuming so if the initial calculation (when attaching the indi to a chart) takes too long do use the MaxBars variable to limit how many bars should be initially calculated.
  7. Like
    for-ex reacted to dhnonline in [SHARE] Forex Master Methods (by Russ Horn)   
    Includes manual, indicators and Template
     
    Info: http://www.forexmastermethods.com/
    Enjoy!!!
     
    download:
     
    hxxp://[email protected]/file/aIot3bYr/FM_Method_System.html
     
    password: indo2
     
    (sorry if I made any mistakes... this is my first post.)
     
    ----------------------------------------------
    UPDATE!!! Here is the rest of the package. Took awhile to upload the whole thing.
     
    Bonus: (contains Currency Power Meter and Trade Locator and various pdf and video)
    hxxp://[email protected]/file/-pBTVB3V/FM_Method_Bonus.html
    password: indo2
     
    Webnairs:
    hxxp://[email protected]/file/DplXrhyO/Russ_Horn_Intro_webinar.html
    hxxp://[email protected]/file/1sN8qnki/2011-06-09-Live-Webinar-001.html
    hxxp://[email protected]/file/crvE_-YJ/2011-06-15-Live-Webinar-002__T.html
    hxxp://[email protected]/file/WiMwvnrj/2011-06-15-Live-Webinar-002.html
    hxxp://[email protected]/file/nEDu7XWs/2011-06-21-Live-Webinar-004.html
    hxxp://[email protected]/file/h4_Tvrxj/2011-06-30-Live-Webinar-005.html
  8. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NDX, NST, NXC et al.
     
    Three bounded Ocean indicators, the first two you already got, the third one is an improved version (thus "x" suffix) of the original with the option to mark zero hits.
     
    Original NDX, NST, NXC on TradeStation:
    http://img705.imageshack.us/img705/7306/ndxnstnxctradestation.png
     
    Ocn_NDX, Ocn_NST, Ocn_NXCx on Metatrader:
    http://img825.imageshack.us/img825/2768/ndxnstnxcmetatrader.png
     
    Original size screenshots:
    http://img802.imageshack.us/img802/7306/ndxnstnxctradestation.png
    http://img402.imageshack.us/img402/2768/ndxnstnxcmetatrader.png
     
     
    However, you don't actually need these three indis at all, because I've combined them all into a single Ocn_NDXNSTNXCx indi, which can:

    show NDX, NST, NXC
    show NXC zero hits
    show a common NDX&NST's NMA
    turn on/off each of these 5 elements individually (so you can for example show NDX and NXC's zero hits without even showing NXC itself)

     
    As for the NMA, you have 4 options there to adjust it:

    the period of NMA
    you can choose whether it should be regular or fast NMA
    if fast then what would be the minimal lookback
    pre-smoothing the data before entering NMA

    The default settings is: period 20, regular NMA, pre-smoothing 1 (means no smoothing). As I mentioned I don't know what should be the default settings, I don't even exactly know how this NMA should be calculated from NDX&NST, however after countless studying the videos and testing and trying I found this settings as somewhat, more or less, give or take, remotely similar to what they have. No guarantee (most probably it's not right) :)
     
    Also, I have done another few changes:

    Ocn_NMA_Price_Osc improved into Ocn_NMA_Price_Oscx: added all SD band lines
    all indis with SD band lines got a third SD band line in the middle, optional of course
    when zero hit was detected the SD bands were zeroed; this is now optional and can be turned on/off
    all indis have versions now

     
    Now the full list of Ocean Classic library (worth $4,995.00) includes:

    Ocn_NMAx
    Ocn_NMA_Price_Oscx
    Ocn_NMA_SD_Band_Osc (orig, keeping this version for compatibility because the improved one got a shifted scale)
    Ocn_NMA_SD_Band_Oscx
    Ocn_NMA_SD_Band_Width (orig)
    Ocn_NMM_X-Ray_1 (orig)
    Ocn_NMM_X-Ray_2 (orig, didn't get any idea what to improve on these last three)
    Ocn_NMM_Ocean_Indexx
    Ocn_NMMx
    Ocn_NMM_MACDx
    Ocn_NMM_ROCx
    Ocn_NMRx
    Ocn_NMSx
    Ocn_NMCx
    Ocn_NMC2x
    Ocn_NDX
    Ocn_NST
    Ocn_NXCx
    Ocn_NDXNSTNXCx

     
    Note: I didn't implement all original options and features, namely those functions showing historical overbought/oversold levels etc. They never demonstrated nor commented it in any video so I just haven't found it worth an effort. It can be implemented if needed, though.
     
    http://uloz.to/xeTvGZd/ocn-classic-7z
     
     
    digian: maybe you could make again the "full bundle" package?
     
    Now it's finally time for BTX/STX.
  9. Like
    for-ex reacted to Grain Trader in Ocean Theory indis from TSD elite   
    hi UDC, Yes you are right the jurik were probably designed for stocks and commodities but I was under the impression that they were also applicable to forex as well. I dont trade forex , I trade commodities but I have noticed that most members here are forex traders. This is the manual for the Jurik tools, they maybe just as good or better than the ocean indicators
    http://www.scribd.com/doc/37296906/Jurik-1
  10. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    resume
     
    Ok, so what I have actually done:

    renamed NMA_Price_Osc to Ocn_NMA_Price_Osc
    renamed NMA_SD_Band_Width to Ocn_NMA_SD_Band_Width
    renamed NMM_X-Ray_1 to Ocn_NMM_X-Ray_1
    renamed NMM_X-Ray_2 to Ocn_NMM_X-Ray_2
    renamed NMA_SD_Band_Osc to Ocn_NMA_SD_Band_Osc (my improved version has different scale so I am keeping the original version too)
    improved NMA_SD_Band_Osc into Ocn_NMA_SD_Band_Oscx
    improved NMM_Ocean_Index into Ocn_NMM_Ocean_Indexx
    improved NMM_ROC into Ocn_NMM_ROCx
    improved NMR into Ocn_NMRx
    improved NMA and Fast_NMA and combined both into a single Ocn_NMAx
    improved NMC and NMC_with_Ocn_MAs and combined both into a single Ocn_NMCx
    improved NMC2 and NMC2_with_Ocn_MAs and combined both into a single Ocn_NMC2x
    improved NMM and NMM_with_Ocn_MAs and combined both into a single Ocn_NMMx
    improved NMM_MACD and NMM_MACD_with_Ocn_MAs and combined both into a single Ocn_NMM_MACDx
    improved NMS and NMS_with_Ocn_MAs and combined both into a single Ocn_NMSx

     
    If you did the same you would end up with 15 indicators. If not, you can download them from here:
    http://uloz.to/xTwJmMJ/ocn-7z
     
    Now I can finally get to NDX, NST and NXC, and then see about BTX/STX buddies.
  11. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMM_MACDx for MT4
     
    Ocn_NMM_MACDx.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_MACD_period = 40; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMM_MACD[]; double ZH[]; double SD[]; double SD2[]; double NMM_MACD_NMA[]; double NMM_MACD_FastNMA[]; double NMM[]; double NMM_MA[]; int init() { string nmmmacdname = "NMM_MACD(" + NMM_MACD_period + ")"; IndicatorShortName(nmmmacdname); IndicatorBuffers(8); SetIndexBuffer(0, NMM_MACD); SetIndexLabel(0, nmmmacdname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMM_MACD_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMM_MACD_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMM_MACD_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMM_MACD_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMM_MACD_NMA); SetIndexBuffer(5, NMM_MACD_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMM_MACD_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMM_MACD_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); SetIndexBuffer(6, NMM); SetIndexBuffer(7, NMM_MA); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double nmm2, sum, abssum, ratio, nmmmacdnum, maxnmmmacd; 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_ZH) { if(NMM_MACD[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - 2*NMM_MACD_period - 1 - SD_len) { if(Show_SD_1line_only) { 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); } else { if(NMM_MACD[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMM_MACD, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMM_MACD, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - 2*NMM_MACD_period - 1 - NMA_period) { ratio = 0; sum = (NMM_MACD[i] - NMM_MACD[i+1]) + (NMM_MACD[i+1] - NMM_MACD[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMM_MACD[i+ii] - NMM_MACD[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMM_MACD[i+ii] - NMM_MACD[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_MACD_NMA[i] = NMM_MACD_NMA[i+1] + (NMM_MACD[i] - NMM_MACD_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - 2*NMM_MACD_period - 1 - NMA_period) { maxnmmmacd = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmmmacdnum = (NMM_MACD[i] - NMM_MACD[i+ii]) / MathSqrt(ii); if(MathAbs(nmmmacdnum) > maxnmmmacd) { maxnmmmacd = MathAbs(nmmmacdnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMM_MACD[i] - NMM_MACD[i+1]) + (NMM_MACD[i+1] - NMM_MACD[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMM_MACD[i+ii] - NMM_MACD[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMM_MACD[i+ii] - NMM_MACD[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_MACD_FastNMA[i] = NMM_MACD_FastNMA[i+1] + (NMM_MACD[i] - NMM_MACD_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/qwN27vxb
  12. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMA_SD_Band_Oscx for MT4
     
    Ocn_NMA_SD_Band_Oscx.
     
    Compared to the original version, there are 2 improvements:

    you can display both NMA and FastNMA band oscilators at the same time
    the whole indicator is shifted by 50 down, so now the middle (when the price is at NMA/FastNMA) is at 0 and the bands are at 50 and -50 (compared to original middle at 50 and bands at 0 and 100), thus you can now use it more like CCI and also its better suitable for use in strategies

     
     

    #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Yellow #property indicator_color2 Aqua #property indicator_level1 50 #property indicator_level2 0 #property indicator_level3 -50 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern bool Show_NMA = true; extern int NMA_period = 40; extern int NMA_SD_len = 30; extern double NMA_SD_up = 2; extern double NMA_SD_dn = 2; extern bool Show_FastNMA = true; extern int FastNMA_period = 40; extern int FastNMA_LB_min = 8; extern int FastNMA_SD_len = 20; extern double FastNMA_SD_up = 1.5; extern double FastNMA_SD_dn = 1.5; double NMA_SD_Band_Osc[]; double NMA[]; double NMA_SDup[]; double NMA_SDdn[]; double FastNMA_SD_Band_Osc[]; double FastNMA[]; double FastNMA_SDup[]; double FastNMA_SDdn[]; int init() { IndicatorShortName("NMA_SD_Band_Osc(" + NMA_period + ", " + FastNMA_period + ", " + FastNMA_LB_min + ")"); IndicatorBuffers(8); SetIndexBuffer(0, NMA_SD_Band_Osc); SetIndexLabel(0, "NMA_SD_Band_Osc(" + NMA_period + ")"); SetIndexBuffer(1, FastNMA_SD_Band_Osc); SetIndexLabel(1, "FastNMA_SD_Band_Osc(" + FastNMA_period + ", " + FastNMA_LB_min + ")"); SetIndexBuffer(2, NMA); SetIndexBuffer(3, NMA_SDup); SetIndexBuffer(4, NMA_SDdn); SetIndexBuffer(5, FastNMA); SetIndexBuffer(6, FastNMA_SDup); SetIndexBuffer(7, FastNMA_SDdn); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); int max = MathMax(Show_NMA * MathMax(NMA_period, NMA_SD_len), Show_FastNMA * MathMax(FastNMA_period, FastNMA_SD_len)); double sum, abssum, ratio, nmmnum, maxnmm; if(Bars <= max) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > max) limit = Bars - counted_bars; else limit = Bars - max - 1; if(Show_NMA) for(i = limit; i >= 0; i--) { ratio = 0; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; NMA[i] = NMA[i+1] + (Close[i] - NMA[i+1]) * ratio; NMA_SDup[i] = NMA[i] + NMA_SD_up * iStdDev(NULL, 0, NMA_SD_len, 0, 0, PRICE_CLOSE, i); NMA_SDdn[i] = NMA[i] - NMA_SD_dn * iStdDev(NULL, 0, NMA_SD_len, 0, 0, PRICE_CLOSE, i); NMA_SD_Band_Osc[i] = ((Close[i] - NMA_SDdn[i]) / (NMA_SDup[i] - NMA_SDdn[i]) * 100) - 50; } if(Show_FastNMA) for(i = limit; i >= 0; i--) { maxnmm = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= FastNMA_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < FastNMA_LB_min) NMA_LB_max = FastNMA_LB_min; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; FastNMA[i] = FastNMA[i+1] + (Close[i] - FastNMA[i+1]) * ratio; FastNMA_SDup[i] = FastNMA[i] + FastNMA_SD_up * iStdDev(NULL, 0, FastNMA_SD_len, 0, 0, PRICE_CLOSE, i); FastNMA_SDdn[i] = FastNMA[i] - FastNMA_SD_dn * iStdDev(NULL, 0, FastNMA_SD_len, 0, 0, PRICE_CLOSE, i); FastNMA_SD_Band_Osc[i] = ((Close[i] - FastNMA_SDdn[i]) / (FastNMA_SDup[i] - FastNMA_SDdn[i]) * 100) - 50; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/HxQ92uEx
  13. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMM_ROCx for MT4
     
    Ocn_NMM_ROCx.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_ROC_period = 40; extern int NMM_ROC_LB = 3; extern int NMM_ROC_AvgLen = 3; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMM_ROC[]; double ZH[]; double SD[]; double SD2[]; double NMM_ROC_NMA[]; double NMM_ROC_FastNMA[]; double NMM[]; double NMM_ROCx[]; int init() { string nmmrocname = "NMM_ROC(" + NMM_ROC_period + ", " + NMM_ROC_LB + ", " + NMM_ROC_AvgLen + ")"; IndicatorShortName(nmmrocname); IndicatorBuffers(8); SetIndexBuffer(0, NMM_ROC); SetIndexLabel(0, nmmrocname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMM_ROC_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMM_ROC_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMM_ROC_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMM_ROC_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMM_ROC_NMA); SetIndexBuffer(5, NMM_ROC_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMM_ROC_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMM_ROC_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); SetIndexBuffer(6, NMM); SetIndexBuffer(7, NMM_ROCx); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double nmm2, sum, abssum, ratio, nmmrocnum, maxnmmroc; if(Bars <= NMM_ROC_period + NMM_ROC_LB + NMM_ROC_AvgLen) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_ROC_period) limit = Bars - counted_bars; else limit = Bars - NMM_ROC_period - 1; for(i = limit; i >= 0; i--) { nmm2 = 0; for(ii = 1; ii <= NMM_ROC_period; ii++) nmm2 += (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); NMM[i] = (nmm2 / NMM_ROC_period) * 1000; } for(i = limit; i >= 0; i--) if(i < Bars - NMM_ROC_period - 1 - NMM_ROC_LB) NMM_ROCx[i] = NMM[i] - NMM[i+NMM_ROC_LB]; for(i = limit; i >= 0; i--) if(i < Bars - NMM_ROC_period - 1 - NMM_ROC_LB - NMM_ROC_AvgLen) { double WtdSum = 0; for(ii = 0; ii < NMM_ROC_AvgLen; ii++) WtdSum += (NMM_ROC_AvgLen - ii) * NMM_ROCx[i+ii]; NMM_ROC[i] = WtdSum / ((NMM_ROC_AvgLen + 1) * NMM_ROC_AvgLen * 0.5); if(Show_ZH) { if(NMM_ROC[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMM_ROC_period - 1 - NMM_ROC_LB - NMM_ROC_AvgLen - SD_len) { if(Show_SD_1line_only) { if(NMM_ROC[i] == 0) SD[i] = 0; else if(NMM_ROC[i] > 0) SD[i] = iBandsOnArray(NMM_ROC, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMM_ROC[i] < 0) SD[i] = iBandsOnArray(NMM_ROC, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } else { if(NMM_ROC[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMM_ROC, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMM_ROC, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_ROC_period - 1 - NMM_ROC_LB - NMM_ROC_AvgLen - NMA_period) { ratio = 0; sum = (NMM_ROC[i] - NMM_ROC[i+1]) + (NMM_ROC[i+1] - NMM_ROC[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMM_ROC[i+ii] - NMM_ROC[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMM_ROC[i+ii] - NMM_ROC[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_ROC_NMA[i] = NMM_ROC_NMA[i+1] + (NMM_ROC[i] - NMM_ROC_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_ROC_period - 1 - NMM_ROC_LB - NMM_ROC_AvgLen - NMA_period) { maxnmmroc = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmmrocnum = (NMM_ROC[i] - NMM_ROC[i+ii]) / MathSqrt(ii); if(MathAbs(nmmrocnum) > maxnmmroc) { maxnmmroc = MathAbs(nmmrocnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMM_ROC[i] - NMM_ROC[i+1]) + (NMM_ROC[i+1] - NMM_ROC[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMM_ROC[i+ii] - NMM_ROC[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMM_ROC[i+ii] - NMM_ROC[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_ROC_FastNMA[i] = NMM_ROC_FastNMA[i+1] + (NMM_ROC[i] - NMM_ROC_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/FNG3fggz
  14. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMAx for MT4
     
    Ocn_NMAx.
     
    Both NMA and FastNMA, each with its own SD bands, all together in a single indicator. You can selectively turn on/off each of all 6 lines, i.e. you can leave only NMA's upper SD band and FastNMA's lower SD band visible and everything else turn off :)
     
     

    #property indicator_chart_window #property indicator_buffers 6 #property indicator_color1 Yellow #property indicator_color2 Gray #property indicator_color3 Gray #property indicator_color4 Aqua #property indicator_color5 Blue #property indicator_color6 Blue extern bool Show_NMA = true; extern int NMA_period = 40; extern int NMA_SD_len = 30; extern bool Show_NMA_SD_up = true; extern double NMA_SD_up = 2; extern bool Show_NMA_SD_dn = true; extern double NMA_SD_dn = 2; extern bool Show_FastNMA = true; extern int FastNMA_period = 40; extern int FastNMA_LB_min = 8; extern int FastNMA_SD_len = 20; extern bool Show_FastNMA_SD_up = true; extern double FastNMA_SD_up = 1.5; extern bool Show_FastNMA_SD_dn = true; extern double FastNMA_SD_dn = 1.5; double NMA[]; double NMA_SDup[]; double NMA_SDdn[]; double FastNMA[]; double FastNMA_SDup[]; double FastNMA_SDdn[]; double NMAx[]; double FastNMAx[]; int init() { IndicatorShortName("NMA(" + NMA_period + ", " + FastNMA_period + ", " + FastNMA_LB_min + ")"); IndicatorBuffers(8); string nmaname = "NMA(" + NMA_period + ")"; string nmasdname = "NMA_SD(" + NMA_SD_len + ")"; string fastnmaname = "FastNMA(" + FastNMA_period + ", " + FastNMA_LB_min + ")"; string fastnmasdname = "FastNMA_SD(" + FastNMA_SD_len + ")"; SetIndexBuffer(0, NMA); SetIndexBuffer(1, NMA_SDup); SetIndexBuffer(2, NMA_SDdn); SetIndexBuffer(3, FastNMA); SetIndexBuffer(4, FastNMA_SDup); SetIndexBuffer(5, FastNMA_SDdn); SetIndexBuffer(6, NMAx); SetIndexBuffer(7, FastNMAx); if(Show_NMA) SetIndexLabel(0, nmaname); else SetIndexLabel(0, "unused"); if(Show_NMA_SD_up) SetIndexLabel(1, nmasdname+"_up"); else SetIndexLabel(1, "unused"); if(Show_NMA_SD_dn) SetIndexLabel(2, nmasdname+"_dn"); else SetIndexLabel(2, "unused"); if(Show_FastNMA) SetIndexLabel(3, fastnmaname); else SetIndexLabel(3, "unused"); if(Show_FastNMA_SD_up) SetIndexLabel(4, fastnmasdname+"_up"); else SetIndexLabel(4, "unused"); if(Show_FastNMA_SD_dn) SetIndexLabel(5, fastnmasdname+"_dn"); else SetIndexLabel(5, "unused"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); int max = MathMax(MathMax(Show_NMA * NMA_period, MathMax(Show_NMA_SD_up, Show_NMA_SD_dn) * MathMax(NMA_period, NMA_SD_len)), MathMax(Show_FastNMA * FastNMA_period, MathMax(Show_FastNMA_SD_up, Show_FastNMA_SD_dn) * MathMax(FastNMA_period, FastNMA_SD_len))); double sum, abssum, ratio, nmmnum, maxnmm; if(Bars <= max) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > max) limit = Bars - counted_bars; else limit = Bars - max - 1; for(i = limit; i >= 0; i--) { ratio = 0; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; NMAx[i] = NMAx[i+1] + (Close[i] - NMAx[i+1]) * ratio; if(Show_NMA) NMA[i] = NMAx[i]; if(Show_NMA_SD_up) NMA_SDup[i] = NMAx[i] + NMA_SD_up * iStdDev(NULL, 0, NMA_SD_len, 0, 0, PRICE_CLOSE, i); if(Show_NMA_SD_dn) NMA_SDdn[i] = NMAx[i] - NMA_SD_dn * iStdDev(NULL, 0, NMA_SD_len, 0, 0, PRICE_CLOSE, i); } for(i = limit; i >= 0; i--) { maxnmm = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= FastNMA_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < FastNMA_LB_min) NMA_LB_max = FastNMA_LB_min; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; FastNMAx[i] = FastNMAx[i+1] + (Close[i] - FastNMAx[i+1]) * ratio; if(Show_FastNMA) FastNMA[i] = FastNMAx[i]; if(Show_FastNMA_SD_up) FastNMA_SDup[i] = FastNMAx[i] + FastNMA_SD_up * iStdDev(NULL, 0, FastNMA_SD_len, 0, 0, PRICE_CLOSE, i); if(Show_FastNMA_SD_dn) FastNMA_SDdn[i] = FastNMAx[i] - FastNMA_SD_dn * iStdDev(NULL, 0, FastNMA_SD_len, 0, 0, PRICE_CLOSE, i); } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/5N5DX4SZ
  15. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMM_Ocean_Indexx
     
    Ocn_NMM_Ocean_Indexx.
     
    This one also didn't have NMAs.
     
    Kinda silly name but since I am giving all these final versions a suffix "x" this is what I got. Of course you can rename it whatever you wish.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_LB = 21; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMM[]; double ZH[]; double SD[]; double SD2[]; double NMM_NMA[]; double NMM_FastNMA[]; int init() { string nmmname = "NMM_Ocean_Index(" + NMM_LB + ")"; IndicatorShortName(nmmname); IndicatorBuffers(6); SetIndexBuffer(0, NMM); SetIndexLabel(0, nmmname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMM_Ocean_Index_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMM_Ocean_Index_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMM_Ocean_Index_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMM_Ocean_Index_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMM_NMA); SetIndexBuffer(5, NMM_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMM_Ocean_Index_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMM_Ocean_Index_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double sum, abssum, ratio, nmmnum, maxnmm; if(Bars <= NMM_LB) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_LB) limit = Bars - counted_bars; else limit = Bars - NMM_LB - 1; for(i = limit; i >= 0; i--) { NMM[i] = (MathLog(Close[i]) - MathLog(Close[i+NMM_LB])) / MathSqrt(NMM_LB) * 1000; if(Show_ZH) { if(NMM[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMM_LB - 1 - SD_len) { if(Show_SD_1line_only) { if(NMM[i] == 0) SD[i] = 0; else if(NMM[i] > 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMM[i] < 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } else { if(NMM[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMM, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_LB - 1 - NMA_period) { ratio = 0; sum = (NMM[i] - NMM[i+1]) + (NMM[i+1] - NMM[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMM[i+ii] - NMM[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMM[i+ii] - NMM[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_NMA[i] = NMM_NMA[i+1] + (NMM[i] - NMM_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_LB - 1 - NMA_period) { maxnmm = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmmnum = (NMM[i] - NMM[i+ii]) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMM[i] - NMM[i+1]) + (NMM[i+1] - NMM[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMM[i+ii] - NMM[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMM[i+ii] - NMM[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_FastNMA[i] = NMM_FastNMA[i+1] + (NMM[i] - NMM_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/z1ibswJF
  16. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMMx for MT4
     
    Ocn_NMMx.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_period = 40; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMM[]; double ZH[]; double SD[]; double SD2[]; double NMM_NMA[]; double NMM_FastNMA[]; int init() { string nmmname = "NMM(" + NMM_period + ")"; IndicatorShortName(nmmname); IndicatorBuffers(6); SetIndexBuffer(0, NMM); SetIndexLabel(0, nmmname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMM_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMM_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMM_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMM_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMM_NMA); SetIndexBuffer(5, NMM_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMM_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMM_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double nmm2, sum, abssum, ratio, nmmnum, maxnmm; if(Bars <= NMM_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_period) limit = Bars - counted_bars; else limit = Bars - NMM_period - 1; for(i = limit; i >= 0; i--) { nmm2 = 0; for(ii = 1; ii <= NMM_period; ii++) nmm2 += (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); NMM[i] = (nmm2 / NMM_period) * 1000; if(Show_ZH) { if(NMM[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMM_period - 1 - SD_len) { if(Show_SD_1line_only) { if(NMM[i] == 0) SD[i] = 0; else if(NMM[i] > 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMM[i] < 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } else { if(NMM[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMM, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_period - 1 - NMA_period) { ratio = 0; sum = (NMM[i] - NMM[i+1]) + (NMM[i+1] - NMM[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMM[i+ii] - NMM[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMM[i+ii] - NMM[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_NMA[i] = NMM_NMA[i+1] + (NMM[i] - NMM_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - NMM_period - 1 - NMA_period) { maxnmm = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmmnum = (NMM[i] - NMM[i+ii]) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMM[i] - NMM[i+1]) + (NMM[i+1] - NMM[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMM[i+ii] - NMM[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMM[i+ii] - NMM[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMM_FastNMA[i] = NMM_FastNMA[i+1] + (NMM[i] - NMM_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/1vnYXeFm
  17. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMRx for MT4
     
    Ocn_NMRx.
     
    This poor one didn't even have NMAs, now it does :)
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMR_period = 40; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMR[]; double ZH[]; double SD[]; double SD2[]; double NMR_NMA[]; double NMR_FastNMA[]; int init() { string nmrname = "NMR(" + NMR_period + ")"; IndicatorShortName(nmrname); IndicatorBuffers(6); SetIndexBuffer(0, NMR); SetIndexLabel(0, nmrname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMR_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMR_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMR_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMR_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMR_NMA); SetIndexBuffer(5, NMR_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMR_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMR_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double nmr2, sum, abssum, ratio, nmrnum, maxnmr; if(Bars <= NMR_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMR_period) limit = Bars - counted_bars; else limit = Bars - NMR_period - 1; for(i = limit; i >= 0; i--) { nmr2 = 0; for(ii = 1; ii <= NMR_period; ii++) nmr2 += (MathLog(Close[i+ii-1]) - MathLog(Close[i+ii])) * (MathSqrt(ii) - MathSqrt(ii-1)); NMR[i] = nmr2 * 1000; if(Show_ZH) { if(NMR[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMR_period - 1 - SD_len) { if(Show_SD_1line_only) { if(NMR[i] == 0) SD[i] = 0; else if(NMR[i] > 0) SD[i] = iBandsOnArray(NMR, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMR[i] < 0) SD[i] = iBandsOnArray(NMR, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } else { if(NMR[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMR, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMR, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - NMR_period - 1 - NMA_period) { ratio = 0; sum = (NMR[i] - NMR[i+1]) + (NMR[i+1] - NMR[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMR[i+ii] - NMR[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMR[i+ii] - NMR[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMR_NMA[i] = NMR_NMA[i+1] + (NMR[i] - NMR_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - NMR_period - 1 - NMA_period) { maxnmr = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmrnum = (NMR[i] - NMR[i+ii]) / MathSqrt(ii); if(MathAbs(nmrnum) > maxnmr) { maxnmr = MathAbs(nmrnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMR[i] - NMR[i+1]) + (NMR[i+1] - NMR[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMR[i+ii] - NMR[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMR[i+ii] - NMR[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMR_FastNMA[i] = NMR_FastNMA[i+1] + (NMR[i] - NMR_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/eUTa0wTj
  18. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMSx for MT4
     
    Ocn_NMSx.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMS_period = 40; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMS[]; double ZH[]; double SD[]; double SD2[]; double NMS_NMA[]; double NMS_FastNMA[]; int init() { string nmsname = "NMS(" + NMS_period + ")"; IndicatorShortName(nmsname); IndicatorBuffers(6); SetIndexBuffer(0, NMS); SetIndexLabel(0, nmsname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMS_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMS_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMS_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMS_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMS_NMA); SetIndexBuffer(5, NMS_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMS_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMS_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); 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; if(Show_ZH) { if(NMS[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMS_period - 1 - SD_len) { if(Show_SD_1line_only) { 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); } else { if(NMS[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMS, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMS, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) 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; } if(Show_FastNMA) 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/3HJn1jfX
  19. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Ocn_NMCx for MT4
     
    Similarly as Ocn_NMC2x, here is Ocn_NMCx.
     
     

    #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 Magenta #property indicator_color2 Lime #property indicator_color3 Silver #property indicator_color4 Silver #property indicator_color5 Yellow #property indicator_color6 Aqua #property indicator_level1 0 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMC_period = 40; extern bool Show_ZH = true; extern double ZH_displacement = 1; extern int ZH_symbol = 115; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; extern bool Show_SD_1line_only = true; extern bool Show_SD_2lines_up = true; extern bool Show_SD_2lines_dn = true; extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_NMA = true; extern bool Show_FastNMA = true; double NMC[]; double ZH[]; double SD[]; double SD2[]; double NMC_NMA[]; double NMC_FastNMA[]; int init() { string nmcname = "NMC(" + NMC_period + ")"; IndicatorShortName(nmcname); IndicatorBuffers(6); SetIndexBuffer(0, NMC); SetIndexLabel(0, nmcname); SetIndexBuffer(1, ZH); SetIndexLabel(1, "NMC_ZH"); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, ZH_symbol); SetIndexBuffer(2, SD); SetIndexBuffer(3, SD2); if(Show_SD_1line_only) { SetIndexLabel(2, "NMC_SD(" + SD_len + ")"); SetIndexLabel(3, "unused"); } else { if(Show_SD_2lines_up) SetIndexLabel(2, "NMC_SD_up(" + SD_len + ")"); else SetIndexLabel(2, "unused"); if(Show_SD_2lines_dn) SetIndexLabel(3, "NMC_SD_dn(" + SD_len + ")"); else SetIndexLabel(3, "unused"); } SetIndexBuffer(4, NMC_NMA); SetIndexBuffer(5, NMC_FastNMA); if(Show_NMA) SetIndexLabel(4, "NMC_NMA(" + NMA_period + ")"); else SetIndexLabel(4, "unused"); if(Show_FastNMA) SetIndexLabel(5, "NMC_FastNMA(" + NMA_period + ", " + NMA_LB_min + ")"); else SetIndexLabel(5, "unused"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); double nmm, nmr, nmm2, nmr2, avg, sign, sum, abssum, ratio, nmcnum, maxnmc; if(Bars <= NMC_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMC_period) limit = Bars - counted_bars; else limit = Bars - NMC_period - 1; for(i = limit; i >= 0; i--) { nmm2 = 0; nmr2 = 0; for(ii = 1; ii <= NMC_period; ii++) { nmm2 += (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); nmr2 += (MathLog(Close[i+ii-1]) - MathLog(Close[i+ii])) * (MathSqrt(ii) - MathSqrt(ii-1)); } nmm = (nmm2 / NMC_period) * 1000; nmr = nmr2 * 1000; avg = ((MathAbs(nmm) * nmr) + (MathAbs(nmr) * nmm)) / 2; if(avg > 0) sign = 1; else if(avg < 0) sign = -1; else sign = 0; NMC[i] = sign * MathSqrt(MathAbs(avg)); if(Show_ZH) { if(NMC[i] == 0) ZH[i] = ZH_displacement; else ZH[i] = EMPTY_VALUE; } } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMC_period - 1 - SD_len) { if(Show_SD_1line_only) { if(NMC[i] == 0) SD[i] = 0; else if(NMC[i] > 0) SD[i] = iBandsOnArray(NMC, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMC[i] < 0) SD[i] = iBandsOnArray(NMC, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } else { if(NMC[i] == 0) { if(Show_SD_2lines_up) SD[i] = 0; if(Show_SD_2lines_dn) SD2[i] = 0; } else { if(Show_SD_2lines_up) SD[i] = iBandsOnArray(NMC, 0, SD_len, SD_up, 0, MODE_UPPER, i); if(Show_SD_2lines_dn) SD2[i] = iBandsOnArray(NMC, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } } } if(Show_NMA) for(i = limit; i >= 0; i--) if(i < Bars - NMC_period - 1 - NMA_period) { ratio = 0; sum = (NMC[i] - NMC[i+1]) + (NMC[i+1] - NMC[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_period; ii++) sum += (NMC[i+ii] - NMC[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_period; ii++) sum += MathAbs(NMC[i+ii] - NMC[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMC_NMA[i] = NMC_NMA[i+1] + (NMC[i] - NMC_NMA[i+1]) * ratio; } if(Show_FastNMA) for(i = limit; i >= 0; i--) if(i < Bars - NMC_period - 1 - NMA_period) { maxnmc = 0; ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmcnum = (NMC[i] - NMC[i+ii]) / MathSqrt(ii); if(MathAbs(nmcnum) > maxnmc) { maxnmc = MathAbs(nmcnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (NMC[i] - NMC[i+1]) + (NMC[i+1] - NMC[i+2]) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (NMC[i+ii] - NMC[i+ii+1]) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(NMC[i+ii] - NMC[i+ii+1]); if(sum != 0) ratio = abssum / sum; NMC_FastNMA[i] = NMC_FastNMA[i+1] + (NMC[i] - NMC_FastNMA[i+1]) * ratio; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/bpVFvmkV
  20. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NMA_SD_Band_Osc for MT4
     
    NMA_SD_Band_Osc.
     
     
    Original NMA_SD_Band_Osc on TradeStation:
    http://img13.imageshack.us/img13/7295/nmasdbandosctradestatio.png
     
    NMA_SD_Band_Osc on Metatrader:
    http://img836.imageshack.us/img836/6674/nmasdbandoscmetatrader.png
     
    Original size screenshots:
    http://img526.imageshack.us/img526/7295/nmasdbandosctradestatio.png
    http://img401.imageshack.us/img401/6674/nmasdbandoscmetatrader.png
     

    #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red #property indicator_level1 0 #property indicator_level2 50 #property indicator_level3 100 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMA_period = 40; extern bool FastNMA = true; extern int NMA_LB_min = 8; extern int SD_len = 20; extern double SD_up = 1.5; extern double SD_dn = 1.5; double SD_Band_Osc[]; double NMA[]; double SDup[]; double SDdn[]; int init() { string nmaname = "NMA_SD_Band_Osc(" + NMA_period + ")"; if(FastNMA) nmaname = "Fast_NMA_SD_Band_Osc(" + NMA_period + ", " + NMA_LB_min + ")"; IndicatorShortName(nmaname); IndicatorBuffers(4); SetIndexBuffer(0, SD_Band_Osc); SetIndexLabel(0, nmaname); SetIndexBuffer(1, NMA); SetIndexBuffer(2, SDup); SetIndexBuffer(3, SDdn); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= MathMax(NMA_period, SD_len)) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > MathMax(NMA_period, SD_len)) limit = Bars - counted_bars; else limit = Bars - MathMax(NMA_period, SD_len) - 1; for(i = limit; i >= 0; i--) { double nmmnum, maxnmm = 0, sum, abssum, ratio = 0; int NMA_LB_max; if(FastNMA) { for(ii = 1; ii <= NMA_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; } else NMA_LB_max = NMA_period; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; NMA[i] = NMA[i+1] + (Close[i] - NMA[i+1]) * ratio; SDup[i] = NMA[i] + SD_up * iStdDev(NULL, 0, SD_len, 0, 0, PRICE_CLOSE, i); SDdn[i] = NMA[i] - SD_dn * iStdDev(NULL, 0, SD_len, 0, 0, PRICE_CLOSE, i); SD_Band_Osc[i] = (Close[i] - SDdn[i]) / (SDup[i] - SDdn[i]) * 100; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/aC6C7ZDH
  21. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NMA_SD_Band_Width for MT4
     
    NMA_SD_Band_Width.
     
    Though fully faithful to the original TradeStation source code, this one shouldn't be called NMA_anything as it has basically nothing to do with NMA. Pat probably didn't realize that he calculates the SD bands from the price, not from the NMA, and thus the difference between the upper and lower band is mere a sum of both deviation constants:

    SDup = NMA + SD_up * StdDev SDdn = NMA - SD_dn * StdDev SDwidth = SDup - SDdn = NMA + SD_up * StdDev - (NMA - SD_dn * StdDev) = NMA - NMA + SD_up * StdDev + SD_dn * StdDev = (SD_up + SD_dn) * iStdDev
     
    EDIT: Pat actually said on the video that what this indicator does is measuring the volatility. I guess he just named it NMA_... for convenience. It's a simple idea but definitely not unuseful.
     
     
    Original NMA_SD_Band_Width on TradeStation:
    http://img339.imageshack.us/img339/3770/nmasdbandwidthtradestat.png
     
    NMA_SD_Band_Width on Metatrader:
    http://img190.imageshack.us/img190/8113/nmasdbandwidthmetatrade.png
     
    Original size screenshots:
    http://img853.imageshack.us/img853/3770/nmasdbandwidthtradestat.png
    http://img189.imageshack.us/img189/8113/nmasdbandwidthmetatrade.png
     

    #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Blue extern int NMA_period = 40; extern bool FastNMA = true; extern int NMA_LB_min = 8; extern int SD_len = 20; extern double SD_up = 1.5; extern double SD_dn = 1.5; extern bool Show_Pct = false; double SD_Band_Width[]; double NMA[]; double SDup[]; double SDdn[]; int init() { string nmaname = "NMA_SD_Band_Width(" + NMA_period + ")"; if(FastNMA) nmaname = "Fast_NMA_SD_Band_Width(" + NMA_period + ", " + NMA_LB_min + ")"; IndicatorShortName(nmaname); IndicatorBuffers(4); SetIndexBuffer(0, SD_Band_Width); SetIndexLabel(0, nmaname); SetIndexBuffer(1, NMA); SetIndexBuffer(2, SDup); SetIndexBuffer(3, SDdn); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= MathMax(NMA_period, SD_len)) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > MathMax(NMA_period, SD_len)) limit = Bars - counted_bars; else limit = Bars - MathMax(NMA_period, SD_len) - 1; for(i = limit; i >= 0; i--) { double nmmnum, maxnmm = 0, sum, abssum, ratio = 0; int NMA_LB_max; if(FastNMA) { for(ii = 1; ii <= NMA_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; } else NMA_LB_max = NMA_period; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; NMA[i] = NMA[i+1] + (Close[i] - NMA[i+1]) * ratio; SDup[i] = NMA[i] + SD_up * iStdDev(NULL, 0, SD_len, 0, 0, PRICE_CLOSE, i); SDdn[i] = NMA[i] - SD_dn * iStdDev(NULL, 0, SD_len, 0, 0, PRICE_CLOSE, i); if(Show_Pct) SD_Band_Width[i] = (SDup[i] - SDdn[i]) / NMA[i] * 100; else SD_Band_Width[i] = SDup[i] - SDdn[i]; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/Bq4yHqAB
  22. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NMM_X-Ray_2 for MT4
     
    NMM_X-Ray_2.
     
    There are two modes (switches) - "Show_value" and "Show_LB". They can be switched on both at the same time, although it's not recommended as they have different scales.
     
    In the "Show_LB" mode the scale is from 0 to 40 (no percentage option) and the same remark regarding the consequences of changing the "NMM_period" variable applies as with NMM_X-Ray_1.
     
    In the "Show_value" mode the chart's fixed minimum and maximum should be deactivated. I added zero dotted line to make the sign line (red) better recognizable.
     
     
    Original NMM_X-Ray_2 on TradeStation:
    http://img600.imageshack.us/img600/8945/nmmxray2tradestation.png
     
    NMM_X-Ray_2 on Metatrader:
    http://img836.imageshack.us/img836/374/nmmxray2metatrader.png
     
    Original size screenshots:
    http://img841.imageshack.us/img841/8945/nmmxray2tradestation.png
    http://img209.imageshack.us/img209/374/nmmxray2metatrader.png
     

    #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 40 #property indicator_buffers 3 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_color3 Aqua #property indicator_level1 0 #property indicator_level2 20 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_period = 40; extern bool Show_value = false; extern bool Show_LB = true; double NMMmaxratio[]; double NMMsign[]; double LBlen[]; int init() { string nmmname = "NMM_X-Ray_2"; IndicatorShortName(nmmname + "(" + NMM_period + ")"); if(Show_value) IndicatorDigits(2); else IndicatorDigits(0); IndicatorBuffers(3); SetIndexBuffer(0, NMMmaxratio); SetIndexLabel(0, nmmname + "(" + NMM_period + ")"); SetIndexBuffer(1, NMMsign); SetIndexLabel(1, nmmname + "_sign"); SetIndexBuffer(2, LBlen); SetIndexLabel(2, nmmname + "_LBlen"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= NMM_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_period) limit = Bars - counted_bars; else limit = Bars - NMM_period - 1; for(i = limit; i >= 0; i--) { double nmmnum, nmmmax = -1, nmmsign, nmmlb; for(ii = 1; ii <= NMM_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > nmmmax) { nmmmax = MathAbs(nmmnum); nmmlb = ii; if(nmmnum > 0) nmmsign = 1; else if(nmmnum < 0) nmmsign = -1; else nmmsign = 0; } } if(Show_value) { NMMmaxratio[i] = nmmmax * 1000; NMMsign[i] = nmmsign; } if(Show_LB) LBlen[i] = nmmlb; } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/4Sxez78d
  23. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NMM_X-Ray_1 for MT4
     
    NMM_X-Ray_1.
     
    The scale of this indicator is from 0 to 40 with a dotted auxiliary middle line at 20. The number 40 is hardwired in the original TradeStation's version, I made it changeable via external variable called "NMM_period". You have no real reason to change it but if you do then you should also change the scale and the middle line appropriately.
     
    Also, there is a switch Show_Pct, turned off by default, to show values in percentage (what was 0 - 40 would be 0 - 100). If you use that switch you should respectively adjust the scale and the middle line.
     
    The TradeStation's version shows only the PosCnt value (the chart line). I show all 3 values (PosCnt, NegCnt and ZeroCnt) where the two others have by default no color assigned (thus are not visible). You can assign them a color, or, you can check their values via "Data Window". All three most recent values are also always shown in the upper left corner of the indicator chart window.
     
     
    Original NMM_X-Ray_1 on TradeStation:
    http://img341.imageshack.us/img341/7481/nmmxray1tradestation.png
     
    NMM_X-Ray_1 on Metatrader:
    http://img10.imageshack.us/img10/6563/nmmxray1metatrader.png
     
    Original size screenshots:
    http://img829.imageshack.us/img829/7481/nmmxray1tradestation.png
    http://img849.imageshack.us/img849/6563/nmmxray1metatrader.png
     

    #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 40 #property indicator_buffers 3 #property indicator_color1 Yellow #property indicator_color2 CLR_NONE #property indicator_color3 CLR_NONE #property indicator_level1 20 #property indicator_levelcolor Gray #property indicator_levelstyle 2 extern int NMM_period = 40; extern bool Show_Pct = false; double NMM[]; double NegCnt[]; double ZeroCnt[]; int init() { string nmmname = "NMM_X-Ray_1"; IndicatorShortName(nmmname + "(" + NMM_period + ")"); IndicatorBuffers(3); SetIndexBuffer(0, NMM); SetIndexLabel(0, nmmname + "(" + NMM_period + ")"); SetIndexBuffer(1, NegCnt); SetIndexLabel(1, nmmname + "_NegCnt"); SetIndexBuffer(2, ZeroCnt); SetIndexLabel(2, nmmname + "_ZeroCnt"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= NMM_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_period) limit = Bars - counted_bars; else limit = Bars - NMM_period - 1; for(i = limit; i >= 0; i--) { double nmmnum, Pos = 0, Neg = 0, Zero = 0; for(ii = 1; ii <= NMM_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(nmmnum > 0) Pos++; else if(nmmnum < 0) Neg++; else Zero++; } if(Show_Pct) { NMM[i] = Pos / NMM_period * 100; NegCnt[i] = Neg / NMM_period * 100; ZeroCnt[i] = Zero / NMM_period * 100; } else { NMM[i] = Pos; NegCnt[i] = Neg; ZeroCnt[i] = Zero; } } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/40qiAPLD
  24. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    Fast NMA for MT4
     
    Fast NMA.
     
    On the screenshots the regular NMA is yellow/gray dotted line, fast NMA is light/dark blue solid line. This one seems to me quite very useful for short-term support/resistance.
     
     
    Original Fast NMA on TradeStation:
    http://img210.imageshack.us/img210/4584/fastnmatradestation.png
     
    Fast NMA on Metatrader:
    http://img829.imageshack.us/img829/2144/fastnmametatrader.png
     
    Original size screenshots:
    http://img821.imageshack.us/img821/4584/fastnmatradestation.png
    http://img3.imageshack.us/img3/2144/fastnmametatrader.png
     

    #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Aqua #property indicator_color2 Blue #property indicator_color3 Blue extern int NMA_period = 40; extern int NMA_LB_min = 8; extern bool Show_SD = true; extern int SD_len = 20; extern double SD_up = 1.5; extern double SD_dn = 1.5; double NMA[]; double SDup[]; double SDdn[]; int init() { string nmaname = "Fast_NMA(" + NMA_period + ", " + NMA_LB_min + ")"; string sdname = "Fast_NMA_SD(" + SD_len + ")"; IndicatorShortName(nmaname); IndicatorBuffers(3); SetIndexBuffer(0, NMA); SetIndexLabel(0, nmaname); SetIndexBuffer(1, SDup); SetIndexLabel(1, sdname+"_up"); SetIndexBuffer(2, SDdn); SetIndexLabel(2, sdname+"_dn"); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= MathMax(NMA_period, SD_len)) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > MathMax(NMA_period, SD_len)) limit = Bars - counted_bars; else limit = Bars - MathMax(NMA_period, SD_len) - 1; for(i = limit; i >= 0; i--) { double nmmnum, maxnmm = 0, sum, abssum, ratio = 0; int NMA_LB_max; for(ii = 1; ii <= NMA_period; ii++) { nmmnum = (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); if(MathAbs(nmmnum) > maxnmm) { maxnmm = MathAbs(nmmnum); NMA_LB_max = ii; } } if(NMA_LB_max < NMA_LB_min) NMA_LB_max = NMA_LB_min; sum = (MathLog(Close[i]) - MathLog(Close[i+1])) + (MathLog(Close[i+1]) - MathLog(Close[i+2])) * (MathSqrt(2)-1); for(ii = 2; ii < NMA_LB_max; ii++) sum += (MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])) * (MathSqrt(ii+1) - MathSqrt(ii)); abssum = MathAbs(sum); sum = 0; for(ii = 0; ii < NMA_LB_max; ii++) sum += MathAbs(MathLog(Close[i+ii]) - MathLog(Close[i+ii+1])); if(sum != 0) ratio = abssum / sum; NMA[i] = NMA[i+1] + (Close[i] - NMA[i+1]) * ratio; if(Show_SD) { SDup[i] = NMA[i] + SD_up * iStdDev(Symbol(), Period(), SD_len, 0, 0, PRICE_CLOSE, i); SDdn[i] = NMA[i] - SD_dn * iStdDev(Symbol(), Period(), SD_len, 0, 0, PRICE_CLOSE, i); } } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/1m9EavNT
  25. Like
    for-ex reacted to udc in Ocean Theory indis from TSD elite   
    NMM for MT4
     
    Now NMM itself.
     
    NMM is basically an average of Ocean Indexes with lookback from 1 to n, where n is NMM_period (40 by default).
    So for example NMM(5) would be:
    ( OceanIndex(1) + OceanIndex(2) + OceanIndex(3) + OceanIndex(4) + OceanIndex(5) ) / 5
     
    Original NMM on TradeStation:
    http://img835.imageshack.us/img835/8959/nmmtradestation.png
     
    NMM on Metatrader:
    http://img820.imageshack.us/img820/5751/nmmmetatrader.png
     
    Original size screenshots:
    http://img833.imageshack.us/img833/8959/nmmtradestation.png
    http://img20.imageshack.us/img20/5751/nmmmetatrader.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_period = 40; extern bool Show_SD = true; extern int SD_len = 30; extern double SD_up = 2; extern double SD_dn = 2; double NMM[]; double SD[]; int init() { string nmmname = "NMM(" + NMM_period + ")"; string sdname = "NMM_SD(" + SD_len + ")"; IndicatorShortName(nmmname); IndicatorBuffers(2); SetIndexBuffer(0, NMM); SetIndexLabel(0, nmmname); SetIndexBuffer(1, SD); SetIndexLabel(1, sdname); return(0); } int start() { int limit, i, ii, counted_bars = IndicatorCounted(); if(Bars <= NMM_period) return(0); if(counted_bars < 0) counted_bars = 0; if(counted_bars > NMM_period) limit = Bars - counted_bars; else limit = Bars - NMM_period - 1; for(i = limit; i >= 0; i--) { double nmm2 = 0; for(ii = 1; ii <= NMM_period; ii++) nmm2 += (MathLog(Close[i]) - MathLog(Close[i+ii])) / MathSqrt(ii); NMM[i] = (nmm2 / NMM_period) * 1000; } if(Show_SD) for(i = limit; i >= 0; i--) if(i < Bars - NMM_period - 1 - SD_len) { if(NMM[i] == 0) SD[i] = 0; else if(NMM[i] > 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_up, 0, MODE_UPPER, i); else if(NMM[i] < 0) SD[i] = iBandsOnArray(NMM, 0, SD_len, SD_dn, 0, MODE_LOWER, i); } return(0); }
     
    The source code is also available for download here:
    http://pastebin.com/K86AJkEE
     
     
    For now I am showing the Ocean indis on the same chart for reference.
×
×
  • Create New...