Rank: Newbie
Groups: Registered, Registered Users Joined: 1/9/2009(UTC) Posts: 3
|
Hello All,
I use the Metastock EOD version and I want to make the following indicator. Perhaps someone of you has already made on like this and would be kind enough to post the function.
I want to make the indicator which gives a buy signal when more than 10% higher price is reached above a low and a sell signal when there is a 10% down from the high.
Kind regards,
Arne
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Hi Arne,
Welcome to the forum. As this post is a little old, you might have already discovered the answer?
If you haven't got the issue resolved then, I suggest you read the MS Users manual and download the free Equis Formula Primer (from the files section) and attempt all the exercises contained therein. This will give you just about all the knowledge required to write this code for yourself.
The reason I and (probably) no-one else has provided a coded answer is because you haven't fully specified by what you mean by "high" and "low". Remember, you want to get a computer to do some work for you, but they cannot interpret what you think you mean; you need to be very explicit when defining your criteria.
Hope this helps.
wabbit [:D]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 1/9/2009(UTC) Posts: 3
|
Hello wabbit,
thanks for your reply, but to make it more specific: I want the highest high of a stock over e.g. the past 100 days and a sell signal when the price falls below 10% of this highest high. And even so for the lowest low of a stock and then when the price rises above 10% of this lowest low a buy signal.
Thanks
Arne
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/13/2009(UTC) Posts: 42
|
Hi Arne
these should do it:
cross(c,ref(LLV(L,21)*1.10,-1))
this code will generate a signal when current bar's close crosses above a value that is 10% higher than the lowest low of the past 21 bars, excluding current bar
cross(ref(HHV(H,21)*0.90,-1),c)
this code will generate a signal when current bar's close crosses below a value that is 10% lower than the highest high of the past 21 bars, excluding current bar
let me know if it works!
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 1/9/2009(UTC) Posts: 3
|
Unfortunately it doesn't, First of all it gives a spike indicator in the chart when tou overlay it over the price chart. The zig zag 0,90 gives a last signal at 09/24 and till the end of the period no more. The zig zag 1.10 gives buy signals at 2/10, 10/10, 17/10 and 28/10. In the mean time it doesn't give a sell signal whereas it should do on 29/09 when you go back tot 23/09 where there was a high of 374 and on 29/09 there was al low of 323 so there is more than a 10% downward move.
So during this period it gives no sell signals???
09/15/2008 386.700 388.690 379.210 385.040 217665376 0 09/16/2008 378.500 381.130 364.980 371.200 283068128 0 09/17/2008 380.560 380.560 356.980 356.980 270847616 0 09/18/2008 354.910 360.030 349.760 351.660 242753008 0 09/19/2008 370.850 381.830 372.560 381.830 354968768 0 09/22/2008 383.180 385.430 375.190 375.190 153741312 0 09/23/2008 373.370 374.340 365.780 367.640 161705328 0 09/24/2008 368.190 370.090 360.620 360.620 126139552 0 09/25/2008 360.000 369.350 359.150 369.350 190917200 0 09/26/2008 364.710 364.710 354.580 354.580 211412624 0 09/29/2008 354.220 354.220 323.550 323.550 258112304 0 09/30/2008 316.800 333.420 310.670 331.450 241196336 0 10/01/2008 335.660 336.730 328.770 334.240 180034688 0 10/02/2008 334.070 342.980 330.830 330.830 190347680 0 10/03/2008 331.950 344.230 328.640 344.020 159382128 0 10/06/2008 328.120 329.890 310.880 312.560 176389456 0 10/07/2008 320.060 320.520 306.780 309.440 179372512 0 10/08/2008 293.660 308.290 280.820 285.660 269515680 0 10/09/2008 287.420 296.570 278.910 281.970 171009872 0 10/10/2008 263.320 270.900 254.360 258.050 302432448 0 10/13/2008 272.960 285.270 269.940 285.270 206736368 0 10/14/2008 299.170 302.770 280.740 284.510 398025472 0 10/15/2008 280.960 281.430 261.830 263.000 226288544 0 10/16/2008 249.150 262.210 244.720 248.040 237415936 0 10/17/2008 259.950 260.970 242.370 252.260 277170304 0 10/20/2008 258.260 269.410 257.620 269.410 218199440 0 10/21/2008 275.320 275.730 267.110 269.360 149590352 0 10/22/2008 262.970 265.940 254.720 255.080 165749808 0 10/23/2008 255.630 258.950 247.190 257.850 170273328 0 10/24/2008 243.970 245.990 232.430 245.920 241821088 0 10/27/2008 235.340 241.810 231.500 237.100 162341136 0 10/28/2008 244.340 244.370 233.020 237.960 184830528 0 10/29/2008 254.080 259.630 249.370 259.580 196324176 0 10/30/2008 265.820 266.210 253.470 257.650 177513216 0 10/31/2008 258.300 267.690 253.020 267.690 147373600 0 11/03/2008 269.570 273.010 266.470 273.010 122084528 0 11/04/2008 274.620 291.130 272.070 291.130 161186736 0 11/05/2008 287.900 287.900 277.520 279.440 153175520 0 11/06/2008 271.680 260.610 260.610 260.610 167561792 0 11/10/2008 273.030 278.190 265.950 267.130 102313696 0 11/11/2008 262.510 264.400 256.790 257.130 106444504 0 11/12/2008 261.710 262.870 247.850 249.250 116116392 0 11/13/2008 245.080 251.840 243.650 249.960 113982720 0 11/14/2008 258.530 258.930 250.820 252.470 115972272 0
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/9/2005(UTC) Posts: 34 Location: Dallas, Texas, USA
|
very clever coding zigzag ... props
|
|
|
|
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.