Rank: Newbie
Groups: Registered Users, Subscribers, Unverified Users Joined: 6/24/2015(UTC) Posts: 5
|
hi any one help me write explore formula
some very good signals were given by an un-smoothed 39 period stochastic oscillator (K = 39, no signal line). A buy signal is generated when K crosses above 50% and the closing price is above the previous week's high close. Sell and/or sell short signals are created when the K line crosses below 50% and the closing price is below the previous week's low close. Taking a longer period(3 years), and not smoothing the data over a 3-period moving average
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,971
Thanks: 94 times Was thanked: 156 time(s) in 151 post(s)
|
MetaStock uses the following parameters for the built-in Stochastic Oscillator function:
(Stochastic Oscillator)
Stoch(%K Periods,%K Smoothing) = %K
i.e.: Stoch(5,3)
(Signal Line)
Mov(Stoch(K% Periods,%K Smoothing),%D Periods,Method) = %D
i.e.: Mov(Stoch(5,3),3,S)
The "Signal Line" is %D, which is traditionally a Simple Moving Average of %K above. I believe that some people refer to %D and "Smoothing" interchangeably, but they are not the same. The signal line is irrelevant if you are not using it in your calculations.
Additionally, if you are using an "unsmoothed" %K, this would not typically be referred to as a "Slow" Stochastic. I think some people refer to the higher number of periods (39) as being slow, but I am pretty sure that the "slow" aspect has traditionally been applied to the %K Smoothing periods. If you want an "Unsmoothed" 39 period Stoch, you would use Stoch(39,1) in your formulas.
While this may seem a bit like semantics, it is important to make these distinctions when trying to assist with writing a formula. Additionally, are you wanting the calculations to be done using Weekly data or Daily data? This can also impact how the formulas are written. If you are scanning using Weekly data, the formulas are much simpler to write. Using Daily data and referring to a previous "end of week" value makes the formulas more complex but still possible to be written. Edited by user Wednesday, June 24, 2015 3:52:20 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Newbie
Groups: Registered Users, Subscribers, Unverified Users Joined: 6/24/2015(UTC) Posts: 5
|
sir,
kindly write complete formula
regarding weely data also 50% and the closing price is above the previous week's high close. Sell and/or sell short signals are created when the K line crosses below 50% and the closing price is below the previous week's low close.
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,971
Thanks: 94 times Was thanked: 156 time(s) in 151 post(s)
|
If the entire formula is designed to be used with Weekly data, then the formula would be quite simple:
{Buy/Long}
Cross(Stoch(39,1),50) AND ROC(C,1,%) > 0
{Sell/Short}
Cross(50,Stoch(39,1)) AND ROC(C,1,%) < 0
|
|
|
|
Rank: Newbie
Groups: Registered Users, Subscribers, Unverified Users Joined: 6/24/2015(UTC) Posts: 5
|
hi
where is weekly formula data also i didn't add ROC in my formula
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,971
Thanks: 94 times Was thanked: 156 time(s) in 151 post(s)
|
Hi,
Apologies as I did misread your original request a bit. Creating a formula like this should be possible, but would probably require a fair amount of conditional logic to account for incomplete/partial weeks, holidays, etc.
If you are not able to find further assistance here, you can always contact our formulas team to see if they can assist with this request:
https://www.metastock.co...s/customformulaform.aspx
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Here's the exploration code I emailed to Jignesh this past weekend. Columns A and B check the current week's daily CLOSEs against the previous week's highest and lowest daily CLOSEs. The use of DayofWeek() less than the previous bar's DayofWeek() is not perfect as a way of separating one week from the next. However, for all but rather exceptional market conditions or closures (such as 9/11 etc.) it's more quite adequate. For 100% accurate separation of daily data into weekly prices on daily or shorter data an accurate "day counter" is required. There are at least two algorithms that I'm aware of, both of which have been incorporated into one or another of my Multi-Frame series of indicators.
Roy (mstt)
{ Jignesh Stochastic Scan }
{ 2015, 27/6/15 }
{ This exploration reports any CLOSE higher }
{ than the previous week's highest CLOSE and }
{ any CLOSE lower than the previous week's }
{ lowest {CLOSE. It also reports the current }
{ 39-period Shochastic value as well as the }
{ current CLOSE. The Filter checks that the }
{ Stochastic is above or below 50 as }
{ required for Columns A or Column B. }
{ColA: Long}
D:=DayOfWeek();
D1:=D<Ref(D,-1);
X:=HighestSince(1,D1,C);
PrvWkHighC:=ValueWhen(1,D1,Ref(X,-1));
CrossHC:=C>ValueWhen(1,D1,PrvWkHighC);
CrossHC*Alert(CrossHC=0,2);
{ColB: Short}
D:=DayOfWeek();
D1:=D<Ref(D,-1);
Y:=LowestSince(1,D1,C);
PrvWkLowC:=ValueWhen(1,D1,Ref(Y,-1));
CrossLC:=C<ValueWhen(1,D1,PrvWkLowC);
CrossLC*Alert(CrossLC=0,2);
{ColC: Up Value}
{Stochastic Up Value}
Value:=Stoch(39,1);
Trigger:=Cross(Value,50);
Value * Trigger;
{ColD: Dn Value}
{Stochastic Down Value}
Value:=Stoch(39,1);
Trigger:=Cross(50,Value);
Value * Trigger;
{ColE: CLOSE}
CLOSE;
{Filter}
colA AND colC>0 OR colB AND colD>0;
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.