NH11 Posted August 11, 2020 Report Share Posted August 11, 2020 Hi I'm writing a scan that includes the current volume being the biggest of the last 5 (incl the current). I know I can use but it's cumbersome. Is there a better way. I tried BarVolume = Max(0, 4, BarVolume) but that has given me errors. Any ideas please. NH. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted August 12, 2020 Report Share Posted August 12, 2020 You're getting an error because you're redefining BarVolume. Don't do that var MaxVol = Max(0, 4, BarVolume); will work. Quote Link to comment Share on other sites More sharing options...
NH11 Posted August 13, 2020 Author Report Share Posted August 13, 2020 OK, I tried that but still getting errors. How do I define the variable MaxVol? Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted August 13, 2020 Report Share Posted August 13, 2020 MaxVol would be Double, but the below would work too - doing "var" just sets the type to whatever the type of Max function is. var MaxVol = Max(0, 4, BarVolume); Quote Link to comment Share on other sites More sharing options...
NH11 Posted August 14, 2020 Author Report Share Posted August 14, 2020 OK, managed to sort it out, many thanks. A few other questions please: 1. Is there a command for the bar's range (High - Low), or would I have to make a variable for that too. 2. Is it possible to round DOWN a number. So 5.3074 to 2 decimal places is 5.30 not 5.31. 3. In my scan results can I have a column for yesterday's high, I only see yesterday's close or volume in column chooser. Many thanks NH Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted August 14, 2020 Report Share Posted August 14, 2020 1. There is no variable but doing High-Low works doesn't it? 2. Well. In your case, do Math.Floor(Num*100)/100 3. There is no data to get yesterday's high from in the L1 feed. That can be figured out from the historical intraday data, and used in the scan by selecting a Horizontal Line indicator and setting it to Previous High. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.