Bullcharts code for Metastock formula |
Post Reply |
Author | |
zzkazu
Regular Joined: 05 Oct 2005 Posts: 27 |
Post Options
Quote Reply
Topic: Bullcharts code for Metastock formula 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 |
|
pipsqueek
Regular Joined: 03 Jan 2005 Location: Australia Posts: 34 |
Post Options Quote Reply 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) ANDRef (L,-2) < L ANDRef (L,-1) < L, {then ...} Ref(L,-2),{2nd day back low, else...}If ((Ref(L,-3)< Ref(L,-2) ANDRef (L,-3) <Ref(L,-1) ANDRef (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) ANDRef (L,-4) < Ref(L,-2) ANDRef (L,-4)< Ref(L,-1) ANDRef (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) ANDRef (L,-5) < Ref(L,-3) ANDRef (L,-5) < Ref(L,-2) ANDRef (L,-5) < Ref(L,-1) ANDRef (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) ANDRef (H,-2)> H ANDRef (H,-1) > H, {then ...} Ref(H,-2), {2ndday back high,else...}If ((Ref(H,-3)> Ref(H,-2) ANDRef (H,-3) > Ref(H,-1) ANDRef (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) ANDRef (H,-4) > Ref(H,-2) ANDRef (H,-4) >Ref(H,-1) ANDRef (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) ANDRef (H,-5) > Ref(H,-3) ANDRef (H,-5) > Ref(H,-2) ANDRef (H,-5)> Ref(H,-1) ANDRef (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.
|
|
zzkazu
Regular Joined: 05 Oct 2005 Posts: 27 |
Post Options Quote Reply 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 |
|
Post Reply |
Forum Jump | Forum Permissions 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 |