I've been trying to write a strategy that uses a stochastic oscillator. I had been creating it using
stoc := CreateIndicator( Symbol, TimeFrame, 'Stochastic', '14;3;3;Close' );
because the stochastic expresses a candle's Close as a percentage of the highest high to lowest low range. Earlier today it was working enough to try running the Strategy Optimiser with it. Then I made some changes and have presumably introduced a programming error that's making Fast Test lock up ForexTester, requiring the use of Task Manager to terminate it. Maybe I'll see the problem when I wake up tomorrow.
However, while trying to find the problem, I noticed that Stochastic windows were being added to the price chart with a caption
(8, 3, 3, illegal value)
and looking at the parameters in the Indicators List's Edit, it seems that the allowable values for the final parameter are
High/Low
Close/Close
although StrPriceType(pt_Close) returns 'Close' and it has no 'High/Low' result matching the example in the List of Indicator Parameters in the Strategy API Help text for the Stochastic.
What's the significance of this final parameter? I've never seen any reference to variations in the stochastic formula in books, as far as I can remember; its shown as
(today's Close - lowest low in %K periods) / (highest high in %K periods - lowest low in %K periods)
in Achelis' book (hence my attempt to make the third parameter select Close).
Phil Bell
Stochastic indicator
-
- Posts: 24
- Joined: Thu Jul 23, 2009 7:20 am
- Location: Brighton, UK
Stochastic indicator
- Attachments
-
- Image2.png (9.85 KiB) Viewed 7441 times
-
- Image1.png (9.64 KiB) Viewed 7441 times
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Stochastic indicator
philBell wrote:I've been trying to write a strategy that uses a stochastic oscillator. I had been creating it using
stoc := CreateIndicator( Symbol, TimeFrame, 'Stochastic', '14;3;3;Close' );
because the stochastic expresses a candle's Close as a percentage of the highest high to lowest low range. Earlier today it was working enough to try running the Strategy Optimiser with it. Then I made some changes and have presumably introduced a programming error that's making Fast Test lock up ForexTester, requiring the use of Task Manager to terminate it. Maybe I'll see the problem when I wake up tomorrow.
However, while trying to find the problem, I noticed that Stochastic windows were being added to the price chart with a caption
(8, 3, 3, illegal value)
and looking at the parameters in the Indicators List's Edit, it seems that the allowable values for the final parameter are
High/Low
Close/Close
although StrPriceType(pt_Close) returns 'Close' and it has no 'High/Low' result matching the example in the List of Indicator Parameters in the Strategy API Help text for the Stochastic.
What's the significance of this final parameter? I've never seen any reference to variations in the stochastic formula in books, as far as I can remember; its shown as
(today's Close - lowest low in %K periods) / (highest high in %K periods - lowest low in %K periods)
in Achelis' book (hence my attempt to make the third parameter select Close).
Phil Bell
Use "Close/Close" instead of just "Close". It should be the same string as you see in Indicator's options. We took this syntax from Meta Trader stochastic.
Hasta la vista
Mike
Mike
Who is online
Users browsing this forum: No registered users and 17 guests