Bullcharts code for Metastock formula
Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullCharts discussion
Forum Discription: General discussion about getting started with BullCharts and exploring its features.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=302
Printed Date: 28 Apr 2025 at 7:21am Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com
Topic: Bullcharts code for Metastock formula
Posted By: zzkazu
Subject: Bullcharts code for Metastock formula
Date Posted: 05 Oct 2005 at 12:41pm
Can somebody convert this Metastock code to Bullcharts..
"HighDays := Input("Enter # days to cover lastHIGH for CBL calc'n:", 3, 55, 13);
If(HIGH < HHV(HIGH, HighDays), {then ...}PREV, {previous CBLhi, else...} If(Ref(L,-2) < Ref(L,-1) AND
Ref(L,-2) < L AND
Ref(L,-1) < L, {then ...} Ref(L,-2),{2nd day back low, else...}
If((Ref(L,-3)< Ref(L,-2) AND
Ref(L,-3) <Ref(L,-1) AND
Ref(L,-3) < L) AND
(Ref(L,-2)< L OR
Ref(L,-1) < L),{then ... } Ref(L,-3), {3rd day back low, else...}
If((Ref(L,-4)<Ref(L,-3) AND
Ref(L,-4) < Ref(L,-2) AND
Ref(L,-4)< Ref(L,-1) AND
Ref(L,-4) < L) AND
(Ref(L,-3)< L OR
Ref(L,-2)< L OR
Ref(L,-1) < L), {then... }
Ref(L,-4), {4th day back low, else...}
If((Ref(L,-5)<Ref(L,-4) AND
Ref(L,-5) < Ref(L,-3) AND
Ref(L,-5) < Ref(L,-2) AND
Ref(L,-5) < Ref(L,-1) AND
Ref(L,-5) < L) AND
(Ref(L,-4)< L OR
Ref(L,-3) < L OR
Ref(L,-2) < L OR
Ref(L,-1) < L), {then ...}Ref(L,-5), {5th day back low, else...} PREV )))))"
and
"{Market closing above is a buy signal}
LowDays := Input("Enter # days to cover lastLOW for CBL calc'n:", 3, 55, 13);
If(LOW > LLV(LOW, LowDays), {then ...} PREV,{previous CBLlo, else...}
If(Ref(H,-2) > Ref(H,-1) AND
Ref(H,-2)> H AND
Ref(H,-1) > H, {then ...} Ref(H,-2), {2ndday back high,else...}
If((Ref(H,-3)> Ref(H,-2) AND
Ref(H,-3) > Ref(H,-1) AND
Ref(H,-3) > H) AND
(Ref(H,-2)> H OR
Ref(H,-1)> H),{then ... } Ref(H,-3), {3rd day back high,else...}
If((Ref(H,-4)>Ref(H,-3) AND
Ref(H,-4) > Ref(H,-2) AND
Ref(H,-4) >Ref(H,-1) AND
Ref(H,-4) > H) AND
(Ref(H,-3)> H OR
Ref(H,-2) > H OR
Ref(H,-1)> H), {then... }
Ref(H,-4), {4th day back high,else...}
If((Ref(H,-5)>Ref(H,-4) AND
Ref(H,-5) > Ref(H,-3) AND
Ref(H,-5) > Ref(H,-2) AND
Ref(H,-5)> Ref(H,-1) AND
Ref(H,-5) > H) AND
(Ref(H,-4)> H OR
Ref(H,-3)> H OR
Ref(H,-2) > H OR
Ref(H,-1) > H), {then ...} Ref(H,-5), {5th dayback high,else...} PREV )))"
Have yet to investigate keys differences..
thanks in advance
greg
|
Replies:
Posted By: pipsqueek
Date Posted: 06 Oct 2005 at 8:02pm
Hi
I've changed the input functions to Bullscript, added in a few closing brackets (hope I've put 'em in the right place), deleted some quote marks, made each plot a different colour and basically left the code alone.
The resulting effort certainly plots 2 lines on chart .... does it do what you were expecting????
...and how do you use it??
[target =price;color=red]
HighDays := input("Enter # days to cover lastHIGH for CBL calc'n:", 13, 3, 55);
If (HIGH < HHV(HIGH, HighDays), {then ...}PREV, {previous CBLhi, else...} If(Ref(L,-2) < Ref(L,-1) AND
Ref (L,-2) < L AND
Ref (L,-1) < L, {then ...} Ref(L,-2),{2nd day back low, else...}
If ((Ref(L,-3)< Ref(L,-2) AND
Ref (L,-3) <Ref(L,-1) AND
Ref (L,-3) < L) AND
(Ref(L,-2)< L OR
Ref(L,-1) < L),{then ... } Ref(L,-3), {3rd day back low, else...}
If ((Ref(L,-4)<Ref(L,-3) AND
Ref (L,-4) < Ref(L,-2) AND
Ref (L,-4)< Ref(L,-1) AND
Ref (L,-4) < L) AND
(Ref(L,-3)< L OR
Ref(L,-2)< L OR
Ref(L,-1) < L), {then... }
Ref (L,-4), {4th day back low, else...}
If ((Ref(L,-5)<Ref(L,-4) AND
Ref (L,-5) < Ref(L,-3) AND
Ref (L,-5) < Ref(L,-2) AND
Ref (L,-5) < Ref(L,-1) AND
Ref (L,-5) < L) AND
(Ref(L,-4)< L OR
Ref(L,-3) < L OR
Ref(L,-2) < L OR
Ref(L,-1) < L), {then ...}Ref(L,-5), {5th day back low, else...} PREV )))));
{and}
[color =green]
{Market closing above is a buy signal}
LowDays := input("Enter # days to cover lastLOW for CBL calc'n:", 13, 3, 55);
If (LOW > LLV(LOW, LowDays), {then ...} PREV,{previous CBLlo, else...}
If (Ref(H,-2) > Ref(H,-1) AND
Ref (H,-2)> H AND
Ref (H,-1) > H, {then ...} Ref(H,-2), {2ndday back high,else...}
If ((Ref(H,-3)> Ref(H,-2) AND
Ref (H,-3) > Ref(H,-1) AND
Ref (H,-3) > H) AND
(Ref(H,-2)> H OR
Ref(H,-1)> H),{then ... } Ref(H,-3), {3rd day back high,else...}
If ((Ref(H,-4)>Ref(H,-3) AND
Ref (H,-4) > Ref(H,-2) AND
Ref (H,-4) >Ref(H,-1) AND
Ref (H,-4) > H) AND
(Ref(H,-3)> H OR
Ref(H,-2) > H OR
Ref(H,-1)> H), {then... }
Ref (H,-4), {4th day back high,else...}
If ((Ref(H,-5)>Ref(H,-4) AND
Ref (H,-5) > Ref(H,-3) AND
Ref (H,-5) > Ref(H,-2) AND
Ref (H,-5)> Ref(H,-1) AND
Ref (H,-5) > H) AND
(Ref(H,-4)> H OR
Ref(H,-3)> H OR
Ref(H,-2) > H OR
Ref(H,-1) > H), {then ...} Ref(H,-5), {5th dayback high,else...} PREV )))))
------------- failing to plan is planning to fail.
|
Posted By: zzkazu
Date Posted: 07 Oct 2005 at 5:51pm
Thanks for doing that pipsqueek. I use it to confirm entry and
exit based on countback theory. It is only one of the few
indicators I use to confirm trends.
zzkazu
|
|