Preferred Stochastic, with EasyLanguage/ Multicharts

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

  1. csancho


    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) -

    PreferredSlowD (Function)

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

    StochasticPreferred (Indicator)

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

    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


    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


    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


    Increase the scale on the Stochastic Chart
  5. 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

    best of luck!

  6. 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) -
    • sk3.png
      File size:
      40.5 KB
  7. csancho


    Ok, It's Done!

    Thank you very much, gttrader.
    Now works Perfectly.