Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 56
|
Hi Bruce,
I'm using the following code and receive a response that I don't expect. I'm using a 2 min chart.
datasettings are 600 bars of data
varVolumeMin = 5000
volumeMult = .1
VolumeLongAve = volume.AVG(300, 30)
If VolumeLongAve < varVolumeMin Then
volumeadjust = (1 - VolumeLongAve / varVolumeMin) * volumeMult
diff = (diff * 1.0005) + .02 + (volumeadjust * 1.0)
End If
for tickers XONE and SLV stockfinder is showing a value of .10
volumeadjust = .10 when displayed as a indicator on the chart. It should be zero. When i use an indicator to display the values for VolumeLongAve and varVolumeMin they appear correct, but instead of a zero I get "10 cents"
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please post the actual RealCode you are using and not just a snippet. The RealCode as posted doesn't actually declare any variables or plot any results. If I copy and paste it into the RealCode Editor, it just generates error messages.
Note that volume in RealCode is expressed in blocks of 100 shares. My best guess at what is happening is that you are multiplying (1 - a very small number) by .1. This returns something which is slightly smaller than .1, but which rounds to .1 for display purposes.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 56
|
Ok, thanks Bruce.
I think I found the problem as you illustrated in your reply. 5000 isn't 5000 shares traded, it's 500K.
once adjusted the problem was fixed.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |