Proquote code help

China Diapers

Established member
Messages
536
Likes
35
Hi,

I am trying to screen for, among other things, candles with a long body, i.e. where the area between the open and close makes up 75% or more of the range of the candle. Actually I am scanning for the previous days candle to fit these criteria. Anybody have an idea how the code for this would look in Proquote?

I came with this, but not working. The results are the same as if I comment out the line:

X = ((ABS(DOpen(1) - DClose(1))) > (range[1] * 0.75))


Thanks
 
Last edited:
Also, I use the following to screen for stocks where the volume is more than or equal to 1,000,000:

v1 = (volume >= 1000000.0)

But this only only screens the volume of the most recent candle. Any ideas o how I can screen stocks with an average volume of 1,000,000?

Thanks again
 
Hey, i look at these things for you and give some clues. I just need to find some time during the day.
 
Adrian,

Do you want to screen this long body candle on the last bar or the one before?
 
ah, thats ok then. I have the big body sreener working but it doesn't take it in account if the next one is an inside bar. i can add that too i think.
 
Awesome. I already have the inside bar screener working thanks, just need to add this to it as a further criteria. Then again if it's not going to take up too much of your time would be interesting to see how you coded it.

Any thoughts on the volume?
 
i post the code when i am sure it is ok.

you got me interested in this:)

Quick question: what is Inside bar for you?

Some says the recent candle body have to inside the high and low of the previous.
Or the high and low of the recent have to be inside the body of the previous.
 
right here is the code i put together:

-----------------------------------
REM Body Colors

whiteBody = (Close >= Open)
blackBody = (Open > Close)

REM Body Size (%)

LargeBodyMinimum = 0.075
smallBodyMaximum = 0.0025
LargeBody = (Close >= Open *(1+largeBodyMinimum) AND whiteBody) OR Close <= Open *(1-largeBodyMinimum) AND blackBody

REM Shadows

smallUpperShadow = (whiteBody AND High <= Close *(1+smallBodyMaximum)) OR (blackBody AND High <= Open *(1+smallBodyMaximum))
smallLowerShadow = (whiteBody AND Low >= Open *(1-smallBodyMaximum)) OR (blackBody AND Low >= Close *(1-smallBodyMaximum))

REM Candle definitions

LongbodyCandle = LargeBody AND smallUpperShadow AND smallLowerShadow

Insidebar = ((blackBody AND (blackbody[1]) AND Low >(Close [1]) AND high <(Open [1]))) OR ((blackBody AND (whiteBody[1]) AND Low <(Close [1]) AND High >(Open [1]))) OR ((whitebody AND (whitebody[1]) AND High <(Close [1]) AND Low >(Open [1]))) OR ((whiteBody AND (blackBody[1])) AND Low <(Open [1]) AND High >(Close [1]))

screener [Longbodycandle[2] and Insidebar[1]]

-------------------------------------------

We have LargebodyMinimum, smallBodyMinimum which can be adjusted for your taste.

You can specify which candle should be screened by adjusting the numbers in the screener line:

screener [Longbodycandle[1] and Insidebar[0]]

[0] is the most recent candle so the second one will be [1] and so on.

I check the volume too but first have to get some lunch.

Please let me know if you find errors in the code. I screened and gave good results but we never know:)

Viktor
 
For me an inside bars high and low are within the range of the previous bar, not necessarily the body of the previous bar.
 
right here is the code i put together:

-----------------------------------
REM Body Colors

whiteBody = (Close >= Open)
blackBody = (Open > Close)

REM Body Size (%)

LargeBodyMinimum = 0.075
smallBodyMaximum = 0.0025
LargeBody = (Close >= Open *(1+largeBodyMinimum) AND whiteBody) OR Close <= Open *(1-largeBodyMinimum) AND blackBody

REM Shadows

smallUpperShadow = (whiteBody AND High <= Close *(1+smallBodyMaximum)) OR (blackBody AND High <= Open *(1+smallBodyMaximum))
smallLowerShadow = (whiteBody AND Low >= Open *(1-smallBodyMaximum)) OR (blackBody AND Low >= Close *(1-smallBodyMaximum))

REM Candle definitions

LongbodyCandle = LargeBody AND smallUpperShadow AND smallLowerShadow

Insidebar = ((blackBody AND (blackbody[1]) AND Low >(Close [1]) AND high <(Open [1]))) OR ((blackBody AND (whiteBody[1]) AND Low <(Close [1]) AND High >(Open [1]))) OR ((whitebody AND (whitebody[1]) AND High <(Close [1]) AND Low >(Open [1]))) OR ((whiteBody AND (blackBody[1])) AND Low <(Open [1]) AND High >(Close [1]))

screener [Longbodycandle[2] and Insidebar[1]]

-------------------------------------------

We have LargebodyMinimum, smallBodyMinimum which can be adjusted for your taste.

You can specify which candle should be screened by adjusting the numbers in the screener line:

screener [Longbodycandle[1] and Insidebar[0]]

[0] is the most recent candle so the second one will be [1] and so on.

I check the volume too but first have to get some lunch.

Please let me know if you find errors in the code. I screened and gave good results but we never know:)

Viktor

Viktor you are a legend. I will try this out when I get home and le tyou know how I get on.
 
ok, at the moment the IB screener in the code checks the bar high-low within the body of the previous one.
 
Rem 1M Volume

v1 = (volume[1] >= 1000000.0)

screener[v1]

---------------------

happy trading.
 
All looking good for the long body + inside bar, I have amalgamated my code with yours and looking good.

The volume is still for a single bar as opposed to the average volume, but that's not really important.

If I make any money with this your check is in the mail.
 
hi there,

Sorry i misunderstood your request about volume. So you would like to filter the ones with an average volume bigger or equal to 1million? How many bars you want to include in the average?

Viktor
 
Top