Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2013(UTC) Posts: 23
Thanks: 1 times
|
hi
member how can write the explore formula for stochastic cross center line (50%) either 51 or 49 but i want alert when this event occurred no matter stock up or down but do not use since bar cross or any indicators or moving averages in formula i know that like
cross(stoch 5,3)20) but this type formula give list all stock which already cross 50% and reach 75 or 10 i need immediately alert when event occurred Edited by user Sunday, August 2, 2015 9:06:06 AM(UTC)
| Reason: Not specified
|
|
|
|
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)
|
Hi jigshir
This exploration will report 1 for the Stochastic crossing above 50, and -1 for the stochastic crossing below 50.
{ColA}
Cross(Stoch(5,3),50) - Cross(50,Stoch(5,3));
{Filter}
colA;
If you want to separate crosses above from crosses below then you could use the following exploration.
{ColA}
Cross(Stoch(5,3),50);
{ColB}
Cross(50,Stoch(5,3));
{Filter}
colA OR colB;
Make sure that you load at least 50-100 data bars for this exercise. Do not use the "Load Minimum Records" option for number of bars to load. Doing so would be as ridiculous as trying to make sense of a chart with only 7 or 8 bars loaded.
You mentioned "alert" in your request. To me that suggests getting an Alert from the Expert Advisor, which could use very similar code but is a quite different tool from the Explorer and probably not what you want.
Roy
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2013(UTC) Posts: 23
Thanks: 1 times
|
hi roy,
thanks for help me Stochastic crossing formula and sorry to bother you
but when i search some explore and try to run but get error so kindly solve like
Metastock Bar Patterns
BAR - 3 Higher Highs
H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3)
BAR - 3 Lower Lows & Reversal H
L>Ref(L,-1) AND Ref(L,-1)Ref(L,-3)
BAR - 3 Lower Lows
|
|
|
|
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)
|
Hi jigshir
There are obvious code mistakes in your sample. MetaStock will always five you some sort of reason for the errorn even if that reason is not immediately clear..
Here are some things to check.
1. Are header comments enclosed in {}. These are called braces braces and should surround any text that is not part of the MetaStock formula you're trying to create. Anything inside braces is a comment and MetaStock ignores all comments. Any text not surrounded by braces is regarded as MetaStock code and it is checked for correct syntax etc.
2. Always terminate a variable definition with a semicolon - even the last variable or line of code. It's not strictly necessary on the last line of code but it's good practice to do so. Ensuring that semicolons are in place means that MetaStock will point to the problem variable and nowhere else (if there really is a problem). Typically the cursor will blink at the beginning of the problem variable, not somewhere further down.
3. Check that you have written the code for each variable correctly (whether named or not).
4. If necessary comment out all code but the first variable and then work your way down until the problem rears its head (shows itself). Be aware that one pair of braces must be closed before encountering another pair of braces, as shown below.
{Comment}
{first variable to test}
{Comment}
{Second variable to test}
{Comment}
{Third variable to test}
Comments must always be enclosed in braces. Variables (your code) can be selectively commented to identify the problem variable. Just be aware that commenting out a variable that is needed for a subsequent active variable will under most conditions force MetaStock to wrongly point to the active variable that cannot find its commented out element.
5. It's usually helpful to copy code from a failing exploration into the Indicator Builder as a new indicator. Troubleshooting indicator code is generally much easier to troubleshoot than experts, explorations or systems because you can check each variable or element visually. This is particularly so when your code fails to produce a result but does not signal an error condition.
Now it's time for you to troubleshoot your own code.
Roy Edited by user Monday, August 10, 2015 5:02:17 AM(UTC)
| Reason: typo in item 5
|
|
|
|
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.