Announcement

Collapse
No announcement yet.

MA Scaling to Stoch

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

  • MA Scaling to Stoch

    Hi

    Ive seen alot of studies that convert stochastics value to scale with price. I am looking for to find/create a script that scales a moving average to fit stochastic ie has a 0- 100 range as stoch is.

    This will enable me to create a strat using ma and stoch when the stoch value is above 20 and so on.


    Initially ill be using this on the ES,



    The link i have put on is pretty much what im after, but im looking for the MA's to be displayed/calculated in the stochastic range.


    Thanks
    Last edited by biswar; 05-14-2004, 03:34 AM.

  • #2
    you might try...

    if you take the MA value and compare it to the highest high/lowest low for the MA length - then you might be able to place the MA value into a 0~100 range..

    I'm not sure if this is exactly what you want, but it might work...

    here is a code example for you..

    PHP Code:
    function makeMASto(MAValueMAStartBarMALength) {
    var 
    0;
    var 
    hHigh 0;
    var 
    lLow 9999999;

      for (
    x=MAStartNBarx>=(MAStartBar-MALength);x--) {
        
    hHigh Math.max(hHigh,high(x));
        
    lLow Math.min(lLow,low(x));
     }
     return ((
    MAValue-lLow)/(hHigh-lLow))*100;

    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      MA Stoch

      I have attacched a script so you get the general idea,

      i would like the stochastics to caclulate and display its usual values 0-100 en have the ema to to also display in that range, there should be four lines all dispalyed between 0 and 100..

      hope this sorta clarifies what im after, if you could edit the attached script thatd be great
      Attached Files

      Comment

      Working...
      X