Jump to content

udc

Members
  • Posts

    224
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by udc

  1. On the first post you list screen shots of the forum where Ocean was discussed. They show up very small and not readable at all. Are they supposed to be full sized images?

     

    Yes, they were supposed. Apparently I messed up the ImageShack uploading process somehow. You can get trial access to that forum for free, that's what I did to make those screenshots. Just don't forget to cancel the subscription before trial is over to avoid being charged.

     

    "These are not just another ordinary indicators. "

     

    They are just indicators. Not enough to make you a winning trader. My mentor likes to say that "an indicator is only as good as the trader that uses it." That applies to all indicators, even those "less ordinary."

     

    Exactly.

     

    By "less ordinariness" I meant that ordinary indicator just takes previous data, makes some calculations with it and spits out some result, all this using logic which is more or less understandable and "logical". Ocean indicators use different logic, not that straightforward, a logic you would come up with only if you think kind of out of the box. For example the mirroring - Jim came up with the idea that the most natural (for him) price 1 minute in the future would be the price 1 minute from the past, a forecast price 5 minutes to the future would be taken from the price 5 minutes in the past, etc. You just can't make up something like that, it's not just some math formula, it's an idea, not ordinary idea. Whether good or bad idea that's a different question, but a non-ordinary idea nevertheless. Or the way he uses logarithms so that if you for example add 50% to some number and then subtract 50% from the result you get the original number. Normally you wouldn't get the original number of course, this is possible only because he uses logarithms. And so on, and so forth. It is more feet on the ground than his Delta theory idea (just how would you even start considering any possible relation between market price action and the moon phase? what kind of thinking would you need to wander that way?) but still it's just not ordinary. He understands math, he understands economy, but that wouldn't be enough. He's got un-ordinary inventive thinking and that's what I value him for. Ordinary ideas give you nothing new, but uncommon ideas enrich you because they stimulate your own out-of-the-box thinking.

     

    If I take for example Jurik's JMA. That's brilliant piece of work, hard work. The code is not trivial, rather complicated, but even though I am not an DSP expert I noticed basically at the first sight what he is doing. I wouldn't think it up myself, but I understand him. It's technical, result of hard work and lot of experience. But it's like "inventing" a new CPU with more cores and smaller dye size. It would be cool but not really inventive, not really nothing new, not really surprising, in fact it would be expectable and ordinary. Jim doesn't do that. He makes up an idea and then the whole strategies around it. His code is simpler than Jurik's, no heavy duty technical hard work, but you just can't understand it just from seeing it without being familiar with the ideas behind. That's why it is also dangerous and why I suggest to quickly walk away unless you are willing to spend a lot of time (and I mean really a lot) trying to understand it.

     

    But exactly as you said, they are just indicators, nothing more. To be successful trader it's not really that crucial when to enter the market, and even not when to exit the market. The most important is money management and psychology, being ready and knowing exactly what to do if/when a position becomes a failure, and then strictly sticking to it. Sadly people just keep ignoring these things because mastering them takes much more than getting familiar with some indicator, so they just keep focusing on indicators, looking for some imaginary holy grail, looking for endless number of shortcuts, which inevitably leads only to their loosing.

  2. Yeah, unfortunately I haven't got much time for this lately, to be more precise no time at all. I still owe myself to make STX and some other stuff. Anyway, here is the latest version of the tools so far with some bugfixes and little improvements:

    http://www.uloz.to/x9eoNms/ocn-mt4-7-24-2012-7z

     

    You can find lot of informations and links to the videos and manuals here in this thread, just browse through the previous pages. A warning though: this whole thing is a kind of different than most of other technical analysis tools and it takes months to absorb all the necessary informations. Without going through this process I wouldn't recommend using it with real money.

  3. Ocn_BTXx version 1.2

     

    New version:

    • switch "Colors_use_threshold" and variable "Threshold" to apply BTX_2line's colors only from a specified level of BTX
    • switch "Show_Histogram" to show BTX in the form of a histogram

    On the picture the first indi is BTX_2line, second is BTX with the threshold set to 35, third is the same in histogram and only upper SD band enabled. All 3 indis have MaxBars set to 300.

     

    http://img444.imageshack.us/img444/9742/btx12.png

     

    Original size screenshot:

    http://img59.imageshack.us/img59/9742/btx12.png

     

    Source code:

    http://pastebin.com/8sUn0FhQ

     

     

    Anyway, what I was trying with these little improvements was to find out whether it would be sufficient to use only one of BTX indis, i.e. to use BTX with builtin functions from BTX_2line, but it seems to me it wouldn't be enough because they have apparently different speed. On the picture the most recent trend is up, BTX_2line's positive part is above and rising but BTX is still declining. So both indis have their value and both should be used. Since they are bounded they could be even dragged to the same chart window (although 12 lines altogether look a bit messy).

  4. STX's (future) improvement

     

    So, while working on the STX indi I've just got an idea for a possible improvement. STX is for placing the stops, right? You open a trade based on something, you set some initial stop based on something (not STX), and then when (if) the trade goes in your direction you start moving the stop according to STX. Now the obvious question is - what timeframe for STX will you pick? In each timeframe the STX will show something different but you can set only one particular value as the stop.

     

    The manual is not very helpful on this - it says you are suppose to:

     

    look at the beauty of the STX as it follows a market, that is, to use one’s innate aesthetic sense—which no computer can yet come anywhere close to—in choosing one’s STX timeframe for a particular trade.

     

    It's very poetic and all but in practical terms you would have to review several charts and before you are finally finished and ready to set the stop the trade may be already under (if you are into short trades). So I think it may be useful to implement a multi-timeframe feature so that you can attach multiple STX indis to a single chart, each STX set to a different timeframe and see all STXs from all timeframes at once. I mean, MTF feature is nothing new but as for this particular indi it may actually be very useful. Just a thought..

  5. hi UDC

    Just wondering if you have the Jurik manual that explains how to plot the different settings for his indicators, not the basic jurik manual that gives an overview of the indicators, just wondering if there was an additional manual with suggested settings

     

    Hi, unfortunately I have only the overview manual.

     

    metal: if you are thinking about buying a new computer and using Win XP on it and you are afraid you wouldn't find the drivers for its hardware then you need either to buy a computer for which you will know in advance there are the drivers or simply buy an older computer. Also you can always go the virtualization way (vmware etc.).

  6. 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. Win XP professional have no limitation

     

    Skeptics said the same about Win 95 when Win XP came up. It wasn't true about Win 95, it is not true about Win XP and it will never ever be true simply because the "limitation" comes up naturally as time goes and new things are made. Old thing (Win XP from 2002) will always be somehow limited in newer environment (new world, new software, new people's needs etc. in 2012) because it logically can't be ready for it. Being backward is not and never was a solution. We don't live in caves anymore, we don't burn witches to death anymore, we don't wash only once a week anymore, whatever way you look at it you just can't stop progress, sadly even if the progress is towards worse (maybe that's what you meant). For example I very don't like the new user interface of Windows 8 but I know sooner or later I will have no choice, eventually. You can't install some new software on Win XP anymore, mainstream support ended already 3 years ago and the extended support will end in 2014 and that will be it.

     

    But why do you put equal sign between a new version of Windows and the money? How many people here actually paid for Windows? I didn't and I am not ashamed to admit it. I am using Windows since 1992 and for the countless times I got irritated, for the countless times Windows damaged or broke something, for the countless gray hairs I got and for apparently shortening my lifetime expectancy, it's me the user, not Microsoft, who should be actually paid. I've never heard that they paid for the damages their defective software caused. But every time I get angry at this software I can at least say to myself "thanks god I didn't pay for this !@#$% of !@#$". I was happy with unix thorough the '80s, since 1995 I am happy with linux, but for some activities the Windows is actually more convenient. But paying for it? Never.

     

    Anyway, to stay on the subject - my trading machines are Wine/Win XP but my workstation is of course Win 7 64 (the same as many others) and not being able to run something on it (Ocean Plus DLL in this case) is just inconvenient to say the least. But maybe there is an updated version compatible with Windows 7 64. I found some other Tradestation indicator using Diamond Lock DLL too and that one does seem to work on Windows 7 64: http://www.neweratrader.com/The-Oscillator/tradestation-net-indicators-and-workspace-installation.html, so there is a hope.

  8. When I finish BTX_2line indi I will probably improve the current BTX indi to optionally show color based on position of BTX_2line, i.e. when green will be above red in BTX_2line the BTX will be in green and vice versa. They say in the manual that the primary tool is BTX (which is nondirectional), in fact they mention BTX_2line just very briefly and it seems the only purpose of BTX_2line is to show whether trend is up or down, but not to show the strength of the trend itself. So I think it may be a good idea to take from BTX_2line this feature of distinguishing up/down and implement it in the form of different color into BTX. Just a thought..
  9. Is the installation package for MetaTrader 4 or Trade Station? Where can I find the installation package?

     

    Also, can the installation package run on Win7 64 bit environment?

     

    I edited my previous post and added the link to the Ocean Plus package.

     

    The installation includes the actual Ocean Plus DLL and a few supporting files, manual files and .ELD file to import into Tradestation. You of course won't import anything into Tradestation, just run the setup to install the DLL, then you get machine ID from GenPCID32.Exe, run keygen and put the ID there and you get the password which in turn enter into OBP1LockPW32.Exe. Both GenPCID32.Exe and OBP1LockPW32.Exe have their shortcuts in the Start menu, so just run the respective shortcuts. When it's installed and keygened verify the proper function of the DLL by running the OBP1Lock32test.exe.

     

    In case someone doesn't want to run the setup, I included the actual files in the "installed_files" folder, so you can simply copy the files into c:\windows\system or anywhere else in the system path and then go on with keygenning.

     

    The setup doesn't run on Win7 64, that can by bypassed by copying the actual files instead. However the Ocean DLL doesn't run on Win7 64 either, I suspect its that (******) Diamond Lock protection. If anyone wants to investigate, you can try it on WinXP 64. If the DLL would run there there is a chance it could be modified to run on Win7 64 as well. That would make sense since the DLL is from 2007 and the protection itself is from 2004. But you need to test it in various OSs first to gather information.

     

    " (mirror it, please, in case I die or something ):"

    Hey udc, you are much needed here, please don't die ;-)

     

    I am not planning to, but, you know, you never know :) Jim & Pat may send assassins after me or something :-S

  10. [[The more confusing bit is that the same logic, once used with the RSX series in the "JMA of RSX" seems to produce results the are very consistent in rt vs historical!! RSX values certainly change within each bar just as closes do in each tick, yet results are consistent both in MT4 and eSignal. There is got to be an easy explanation but it is evading me now! ]] Update: it does do as JMA albeit harder to see!

     

    I see what probably confused you - while in Ocean indis where I used JMA I do calculate JMA all over again at every new tick, I do not do that in JMAofRSX and RSXofJMA I posted here. The explanation is quite simple - those two were just "by the way", just quickies. If you look at the Ocean indis I published here I had to transform the JMA code into a function, I adjusted the code to the visual style I am used to and while reviewing it I noticed a potential problem with repainting as I explained before so I did what I could to avoid it. With JMAofRSX and RSXofJMA I didn't think about anything, I was just reading the Jurik tools manual and there were pictures of JMAofRSX and RSXofJMA so I just wanted to see it in my Metatrader so I simply took the original JMA and RSX codes off the TSD forum and just put them together. It took just a few minutes, I didn't review nor adjust nor improve the code, I didn't give it any thought. I published it simply because "why not?", but it isn't "my" code meaning it didn't go through my way of programming, didn't pass my QA so to speak.

     

    So, sorry for confusion. On the other hard thanks to that you discovered and confirmed my suspicion which is really great because I most probably wouldn't have time to do that. Thank you for that! It's cool that people are that observing.

  11. 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:

    1. install Ocean Plus package and keygen it
    2. 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
      


    3. 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
    4. 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).

  12. @udc, I noticed you were recalculating JMA across all bars on every tick in your JMA function, is that to take care of this situation?

     

    Yes. The code, as was written for MT4 by someone else (and I don't know how close or far it is from the original Jurik's software), does use some variables which are initialized only once at the very beginning and then they are just modified as the calculations progress. I didn't examine the logic much but at the first glance it seemed to me like it was calculating some error and as more bars are calculated the error is lesser and lesser. But that's just my wild guess and the reality may be totally different. Now the problem with Metatrader is that the last two bars are recalculated at every tick. Thus if my assumption was correct then this whole error calculation would get logically broken because for the same bar the error (and thus the resulting indicator value) would be different every time. That's why I simply reset all those values and calculate everything from the beginning at every new tick, that way it can't end up with different values. I know it's lame but I wanted to get it done fast and move forward.

     

    udc,

     

    how did the tsd-guys solve the dll problem of the BTX/STX indicators ?

     

    Sixer

     

    They didn't, there is no BTX/STX on Metatrader to my knowledge. Even more reason to want it :)

  13. BTX/STX Tradestation -> Metatrader conversion status

     

    I am still working on getting BTX/STX into Metatrader, though I haven't been successful in initializing the Ocean Plus DLL (OBP1Lock32.dll) from within Metatrader yet.

     

    If anyone wants to help (or knows someone who may be able to help) the problem is this:

     

    In Tradestation, after installing and keygenning the Ocean Plus for TS package, the following indicator source code will show "TRUE" in the EasyLanguage Output Bar / Print Log:

    DefineDLLFunc: "OBP1Lock32.dll", BOOL, "LTInitializeFromIni";
    IF CURRENTBAR = 1 THEN PRINT (LTInitializeFromIni);
    

     

    http://img214.imageshack.us/img214/7558/oceanplustradestation.png

     

    But if I run the following script (basically identical to Tradestation code) in Metatrader I get 0 (false):

    #import "OBP1Lock32.dll"
     bool LTInitializeFromIni;
    #import
    
    void start()
    {
    Print(LTInitializeFromIni);
    }
    

     

    http://img859.imageshack.us/img859/4107/oceanplusmetatrader.png

     

    Since I can't initialize, all further function calls just return 0. Now debugging Metatrader nor the DLL is not trivial since Metatrader is protected by Themida and the DLL by Diamond Lock (which in turn seems to use PC Guard). Maybe the DLL somehow checks what is calling it and will "talk" only to Tradestation (its DLL).

     

    I want BTX in my chart so I am not giving up easily but I may just do that, eventually.

  14. JMA of RSX

     

    The other way around - RSX is made of HIGH+LOW and JMA is made of RSX. Jurik demonstrated it as an example of crossover strategy. I've made the vertical lines by hand, just out of curiosity.

     

    http://img844.imageshack.us/img844/7829/jmaofrsx.png

     

    Original size screenshot:

    http://img198.imageshack.us/img198/7829/jmaofrsx.png

     

    Jurik_JMAofRSX:

    http://pastebin.com/ieCJvpkX

  15. It would be even better if you have them in one indicator combined - NDX with JMA and RSX

     

    You can do that easily - just put the first indi onto a chart and then put the other one over it in the same window and you will get this:

    http://img217.imageshack.us/img217/3089/ndxjmarsx.png

     

    Original size screenshot:

    http://img3.imageshack.us/img3/3089/ndxjmarsx.png

     

    You just need to make sure all overlayered indis have fixed minimum and maximum. They even may have a different scale as in this example where NDX is -100 to 100 and RSX is 0 to 100. As long as both limits are explicitly set, the middle of all indicators will logically match and that's what matters.

     

    Jurik_RSX for reference:

    http://pastebin.com/QRjtCfh4

     

     

    Any progress with BTX/STX?

     

    So far nope.

×
×
  • Create New...