Market Thermometer |
Post Reply |
Author | |
lmbull
Newbie Joined: 08 Dec 2006 Posts: 11 |
Post Options
Quote Reply
Topic: Market Thermometer Posted: 22 Oct 2007 at 2:27pm |
I was wondering if anyone has looked at the safety in the market
Thermometer.It is just a momentum indicator giving a value from -5 to +5. If todays close > yesterdays close -> temp +2 else if less then -2. If todays close > todays open -> temp +2 else if less then -2, If todays range is > yesterdays close -> +1 else if less then -1 As simple as this seems i am still having trouble adding the +2 etc to a value such as temp and then having the result come up in a ribbon with a string of nuumbers. |
|
blackdog
Regular Joined: 14 Nov 2006 Location: Vatican City State Posts: 43 |
Post Options Quote Reply Posted: 22 Oct 2007 at 6:59pm |
Imbull,
You can only set a varable once in BC. So you have to code it the long way. I had a bit of a play with it and here is some coding for you to start with.
[description ="the safety in the market Thermometer. It is just a momentum indicator giving a value from-5 to +5. If todays close > yesterdays close -> temp +2 else if less then -2. If todays close > todays open -> temp +2 else if less then -2, If todays range is > yesterdays close -> +1 else if less then -1" ][target =Ribbon; category=zzz]
CgtC:= loadSymbol("XAO",C)>hist(loadSymbol("XAO",C),1);{todays close > yesterdays close}CgtO:= loadSymbol("XAO",C)>loadSymbol("XAO",O); {todays close > todays open}RgtC:= loadSymbol("XAO",H)>hist(loadSymbol("XAO",C),1); {todays range is > yesterdays close}Therm:= if(CgtC and CgtO and RgtC,5, if(CgtC and CgtO {and not RgtC}, 3, if(CgtC {and not CgtO} and RgtC, 1, if({not CgtC and }CgtO and RgtC, 1, if(CgtC {and not CgtO and not RgtC}, -1, if({not CgtC and} CgtO {and not RgtC}, -1, if({not CgtC and not CgtO and} RgtC, -3,-5)))))));[color =Dark green; name=+5][fillstyle =solid]Therm= 5; [color =light green; name=+3][fillstyle =solid]Therm = 3; [color =light green; name=+1][fillstyle =narrow vertical]Therm = 1; [color =pink; name=-1][fillstyle =narrow vertical]Therm = -1; [color =pink; name=-3][fillstyle =solid]Therm = -3; [color =red; name=-5][fillstyle =solid]Therm= -5; [color =White]
|
|
lmbull
Newbie Joined: 08 Dec 2006 Posts: 11 |
Post Options Quote Reply Posted: 23 Oct 2007 at 1:47am |
Thank you Blackdog for your quick response. This was exactly what I
was looking for, although the full use of its implementation still needs to be looked into. At least now I can examine it in more detail even though it is just another momentum measurement. My coding years seem to be much too far in the past and need a lot more work. |
|
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 |