Jump to content
Medved Trader Forums

BarVolume at the time the candle is processed


Recommended Posts

How can I have the BarVolume be taken at the time the candle is processed rather than the current one?
 

For Example,

if (  ((High-Low[2]) > 0.5) && BarVolume > 10000000)

I want the BarVolume to be considered at the time when the (High-Low[2]) > 0.5

Link to comment
Share on other sites

I am not sure what the problem is. BarVolume is the volume of the current candle, even if it is not complete.

If you show the results in paintbar, it should show in scan as well. The caveat here is that the initial conditions have to be the same between the two. That is, they both should be intraday or historical, both have the same extended hour setting, both have the same frequency.

Link to comment
Share on other sites

I don't have alerts. I only have a paintbar that includes High/Low/Open/close and BarVolume. 
Oh, you mean the scan results? 

If so, is there no work around it? If I have 3000 symbols, can't I have the scanner in a way show me only the tickers with paintbar on?

 

Edited by 3acor
Link to comment
Share on other sites

Yes, scan results only show if the condition is true on the current - last - candle of the chart. Unlike the paintbar that can show if the condition was true on any candle in the chart.

That's the whole point of the scanner - you can scan 3000 symbols and show only the tickers for which the condition is NOW true.  You can, of course, write the scanner with a condition "if this condition was true in any of the last N candles", too.

Link to comment
Share on other sites

If(Any(0,1000,(BarVolume >=300000000 && ((High-Low)/Low >=0.5))) )
Some tickers are not showing on the scanner. For example, ticker SPI will show a paintbar but will not show on the scanner. 

Is my code wrong?
Edited by 3acor
Link to comment
Share on other sites

1. This is EXTREMELY inefficient. It has to loop through the last 1000 candles EVERY time there is a trade in the stock. I am surprised your MT didn't slow down to a crawl.

2. This says: if any of the last 1000 candles had a volume that was greater than 300M and went up more than 50%  from low to high in ONE candle...  Was there a candle in SPI that fit that criteria?

Link to comment
Share on other sites

1. Oh I thought the Any function starts counting starting as of the current day, not as of the current candle being processed. So I  chose 1000 as of the current today (to go back 5 years). Now I changed it to 0 and got the same results. 


2. Yes, SPI had that on September 23, 2020.
I have attached a screenshot showing the paintbar working but nothing on the scanner ( I disabled the Filter in Portfolio)
 

 

njlN9JOzCJ.png

Edited by 3acor
Link to comment
Share on other sites

Ok I see why this is happening. The historical scanner assumes that you don't need more than 500 candles to work on. Apparently a bad assumption.

I removed that. Well, made it bigger - 3000 candles. 3000 trading days back - hopefully that's more than anyone would need.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...