Preferred Stochastic, with EasyLanguage/ Multicharts

Discussion in 'Trading Software' started by csancho, Apr 2, 2008.

  1. csancho

    csancho

    Hello,
    I'm testing the Multicharts platform, And trying to create the "Preffered Stochastic" of DiNapoli. I apply in the power language editor the code in the book:


    PreferredSlowK (Function)

    Inputs: SlowKLen(Numeric), FastKLen(Numeric);
    PreferredSlowK = PreferredSlowK[1] + ((1/SlowKLen)*(FastK(FastKLen) -
    PreferredSlowK[l]));

    PreferredSlowD (Function)

    Input: FastKLen(Numeric), SlowKLen(Numeric), SlowDLen(Numeric);
    PreferredSlowD = PreferredSlowD[1] + ((1/SlowDLen)*(PreferredSlowK(SlowKLen,
    FastKLen)-PreferredSlowD[1]));

    StochasticPreferred (Indicator)

    Input: FastKLen(8), SlowKLen(3), SlowDLen(3);
    Plot1(PreferredSlowK(SlowKLen, FastKLen), "%K");
    Plot2(PreferredSlowD(FastKLen, SlowKLen, SlowDLen), "%D");
    If CheckAlert then
    begin
    If Plot1 crosses above Plot2 or
    Plot1 crosses below Plot2 then
    Alert = TRUE;
    end;


    I passed the "compile" button, and everything is ok, but when I tried to put in a chart, there is an error message that says:
    "Message: Error in study "StochasticPreferred": Not enough series length. Bars reference value: 1370"

    I don't know where is the problem. I would thanks if someone knows what could I do.
     
  2. gttrader

    gttrader

    I think the "Not enough series length. Bars reference value:" error indicates that there is not enough data loaded in the chart. Try editing the symbol and increasing the number of bars back.
     
  3. csancho

    csancho

    Thank you gttrader.
    I did it, and finally it draws an stochasticPreferred, but the draw is just a line.
    It has to be an error in the language, but, where?
     
  4. bakrob99

    bakrob99

    Increase the scale on the Stochastic Chart
     
  5. bolstoch

    bolstoch

    Hey csancho,

    Sounds like a struggle, I like technicals but not easy language. Been trading for 18 months and found timetotrade alerts do the job. My Stochastic set up is %K 14 SP 3 %D3, followed by a Macd crossover - you can easily change the settings to DiNapoli http://www.timetotrade.eu/wiki/index.php/Stochastic

    best of luck!

    bolstoch
     
  6. gttrader

    gttrader

    Found the error, just a simple typo at the end of the PreferredSlowK there is an l in place of a 1. Should be like this.

    PreferredSlowK (Function)

    Inputs: SlowKLen(Numeric), FastKLen(Numeric);
    PreferredSlowK = PreferredSlowK[1] + ((1/SlowKLen)*(FastK(FastKLen) -
    PreferredSlowK[1]));
     
    • sk3.png
      File size:
      40.5 KB
      Views:
      265
  7. csancho

    csancho

    Ok, It's Done!

    Thank you very much, gttrader.
    Now works Perfectly.