Login Page - Create Account

Support Board


Date/Time: Fri, 21 Feb 2025 18:36:07 +0000



[User Discussion] - Buy/Sell Pressure Study Help

View Count: 7810

[2014-04-24 23:52:24]
cmet - Posts: 639
Would like to create a simple buy/sell pressure using upticks and downticks but expressed as a percentage.

Simple Formula:((Total Upticks - Total DownTicks) / (Total Upticks + Total DownTicks) )* 100

Ideally I would like this to be plotted as a "meter" where 0% would be in the middle with 100% and -100% on the ends.

In real time, the dominant color (green for a higher uptick percentage, red for higher downtick percentage) would fill up more of the meter.

Here is an image of sentiment meters (these are for FX but pretty much what I'm looking for):

http://s30.postimg.org/t4brbi7gh/meters.png

Is this (or something similar) possible in SC?



[2014-04-25 07:42:20]
Sierra Chart Engineering - Posts: 104368
In this formula:
((Total Upticks - Total DownTicks) / (Total Upticks + Total DownTicks) )* 100

What is the time period for these variables?

For an individual chart bar?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-04-25 12:07:44]
cmet - Posts: 639
Time period is pretty much irrelevant since it's using the tick data and would update in real time based on buying/selling activity in a particular product. The readings would just be taken from the chart itself on a tick by tick basis and accumulated over the length of the session.

Only other setting needed would be that it starts over at zero from the beginning of the session.

A nice implementation of this I've seen is plotted vertically on the left side of the chart like these mockups:

Buying Pressure:

http://s27.postimg.org/ux18qzklv/meterup.jpg

Selling Pressure:

http://s4.postimg.org/hgqvemb71/meterdown.jpg

Very useful sentiment indicator to help you quickly gauge the underlying pressure in the market in real time. Also, since it's using total ticks on the session, it's not usually jumping around from positive to negative on every single rotation during the day.


Date Time Of Last Edit: 2014-04-25 12:16:13
[2014-04-25 18:04:21]
Sierra Chart Engineering - Posts: 104368
This is definitely advanced programming. We cannot provide any specific help with it, but Sierra Chart does have the general capabilities to accomplish this. It is up to you to implement this.


You can access the data you need with the Base Data arrays:
https://www.sierrachart.com/index.php?l=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scBaseDataIn

For the actual drawing, we recommend using the ACSIL drawing tools:
https://www.sierrachart.com/index.php?l=doc/doc_DLLTools.html
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-04-25 18:14:58]
cmet - Posts: 639
Oh, okay. I would think the cummulative net tick formula above was simple.

I know more than a few traders at the CBOT who use sentiment indicators like this to trade intraday so am intersted in having it done.

Where do I find a programmer who can do something like this?
Date Time Of Last Edit: 2014-04-25 18:15:15
[2014-04-25 23:53:50]
crazybears - Posts: 314
Hi
if you don't have hurry i could try to code it
something basic , displayed like a histogram
IMHO Total Upticks + Total DownTicks is equal to volume
[2014-04-26 01:33:50]
cmet - Posts: 639
Sure if you can use the exact formula mentioned above where the output is expressed as percentage.

Total Upticks + Total DownTicks is not volume though. It's how many times the bid was hit or the offer lifted without regards to the amounts traded.

This is really not a complex indicator. The only thing that might be challenging is to get it to display as described above. The vertical "meter" is nice but a horizontal one like those shown in the first image is fine too.

Just looking for something that's very clear by just glancing at it.

[2014-04-27 20:08:45]
crazybears - Posts: 314
Hi

i made a very basic version .
i'm not able to code complex drawings like you posted
maybe someone could add more options.


http://www.sierrachart.com/image.php?l=1398628229600.png


attachmentBuySellPressure.cpp - Attached On 2014-04-27 20:08:30 UTC - Size: 2.21 KB - 684 views
[2014-04-27 20:15:32]
crazybears - Posts: 314
if you like to have draw on main panel with only text on the left as in picture,

you add the study and set
Chart region =1
Scale =Independent
on Subgraphs tab
set Draw style as Subgraph name and value label only
set name label and value label to show
Horizontal align left edge
[2014-04-27 21:37:08]
cmet - Posts: 639
Hey, thanks

Is this based on the formula mentioned above?

((Total Upticks - Total DownTicks) / (Total Upticks + Total DownTicks) )* 100

If so, are those scale numbers percentage based (ie: 9.5 = 95%, -3.0 = -30%)?


[2014-04-27 21:57:58]
crazybears - Posts: 314
i thought that at the start of each day indicator is reset and indicator is calculated accumulated on each new tick , not for each single bar , am i wrong?

UpT[Index] = UpT[Index - 1] + sc.UpTickVolume[Index];
DownT[Index] = DownT[Index - 1] + sc.DownTickVolume[Index];
TotUpDownT[Index]=UpT[Index]+DownT[Index];
BuySellMeter[Index] = ((UpT[Index]-DownT[Index])/(TotUpDownT[Index]))*100;



[2014-04-27 22:32:39]
crazybears - Posts: 314
ok i made mistake using up and dow tick volume .
make 2 version using

sc.BaseData[SC_BIDNT] or sc.NumberOfBidTrades: The array containing the total number of trades at the bid price or lower. For this to work properly, the Intraday Data Storage Time Unit setting in Global Settings >> Data/Trade Service Settings. needs to be 1 Tick. This will also not work on historical data that does not have bid volume. In the case of Tick, Volume, and Range charts, the data in this array may not be correct if Chart >>Chart Settings >> Split Data Records is enabled, unless you are using tick data and the chart is based on Ticks or a Range.

If you are using this array in your study function, you must set sc.MaintainAdditionalChartDataArrays to 1 in the sc.SetDefaults code block.
sc.BaseData[SC_ASKNT] or sc.NumberOfAskTrades: The array containing the total number of trades at the ask price or higher. For this to work properly, the Intraday Data Storage Time Unit setting in Global Settings >> Data/Trade Service Settings needs to be 1 Tick. This will also not work on historical data that does not have ask volume. In the case of Tick, Volume, and Range charts, the data in this array may not be correct if Chart >>Chart Settings >> Split Data Records is enabled, unless you are using tick data and the chart is based on Ticks or a Range.
visually the result is slightly different
attachmentBuySellPressure2.cpp - Attached On 2014-04-27 22:32:35 UTC - Size: 2.24 KB - 883 views
[2014-04-27 23:06:13]
cmet - Posts: 639
Not quite what I was looking for. This isn't a volume based calculation. It should never plot above 10 (or 100%) or below -10 (or -100%)

I can just use the S&P net tick (NTCK-SP with Rithmic)

Thanks though.
[2014-04-28 01:42:50]
cmet - Posts: 639
For comparison purposes, here is the S&P 500 Net Tick for the day session on Friday.

You can clearly see that the market was dominated by selling pressure all day without much let up.

http://s30.postimg.org/eibyljlox/spnettick_4_25.jpg

Would have been easy to get fooled by the 8 point move around 8am to 9am PST if you were only watching price (or even cumulative delta).

Net Tick showed almost no buying pressure at all during the upswings.

Very useful information intraday.
Date Time Of Last Edit: 2014-04-28 01:44:00
[2014-11-04 20:05:31]
jivetrader - Posts: 410
i am also interested. has there been any further progress on this?

i see that a retail product is available: http://ofetoolbox.kajabi.com/sp/26526-non-ofe-members-trade-delta


[2021-01-24 05:56:15]
User208416 - Posts: 39
iam trying to use the buysell pressure code by crazybears but it failes with an error while compiling . any one knows what is wrong with the BuySellPressure2.cpp code ?


-- Starting remote build of Custom Studies Source files: BuySellPressure2.cpp. 64-bit -- 21:47:06

Allow time for the server to compile the files and build the DLL.

The remote build did not succeed. Result:

BuySellPressure2.cpp: In function 'void scsf_BUYSELLPRESS2(SCStudyInterfaceRef)':
BuySellPressure2.cpp:41:116: error: 'DAYS' was not declared in this scope
41 | SCDateTime NextSessionStart = sc.GetTradingDayStartDateTimeOfBar(sc.BaseDateTimeIn[sc.UpdateStartIndex - 1 ]) + 1*DAYS;
| ^~~~

-- End of Build -- 21:47:10
[2021-01-24 09:45:03]
Ackin - Posts: 1865
similar as "Bid Ask Volume Ratio" study

what is wrong with the BuySellPressure2.cpp code
Required SCDateTime Changes for ACSIL


Working with the SCDateTime Variables and Values

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account