Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Receiving an unexpected result Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Onereason
Posted : Monday, October 7, 2013 4:01:28 PM
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"

 

Bruce_L
Posted : Monday, October 7, 2013 4:27:43 PM


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
Onereason
Posted : Tuesday, October 8, 2013 8:07:12 AM
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.

Bruce_L
Posted : Tuesday, October 8, 2013 8:17:07 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

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.