iftl2015 wrote: ↑July 31st, 2022, 10:51 pm
I am trying to make it work with a stock price websocket site.
First of all, If you share a code, use the code section on the panel
You can do this in a simple way with Webparser.
Since I do not know your API key, I am sharing an example for the Binance exchange.
Skin shows 3 Symbols.
You just need to change the TradeSymbol variables to the parity you want.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=0
;=====================================================================================
[Variables]
TradeSymbol1=BTCUSDT
TradeSymbol2=ADAUSDT
TradeSymbol3=USDTTRY
TextFace=Product Sans
TextCol=255,255,255
TextSize=15
TextSpacing=15
;---------- PRICE ----------
UpCol=0,255,0
DownCol=255,120,120
;---------- PERCENTAGE CHANGE ----------
;0=VISIBLE, 1=HIDDEN
PercentageEnabled=0
PercentageTextSize=(#TextSize# * 0.5)
;---------- BINANCE API TRADESYMBOL 1 ----------
[MeasureBinancePriceData1]
Measure=WebParser
URL=https://api.binance.me/api/v3/ticker/24hr?symbol=#TradeSymbol1#
UpdateRate=2
RegExp=(?siU)"priceChangePercent":"(.*)","weightedAvgPrice":".*","prevClosePrice":".*","lastPrice":"(.*)"
OnConnectErrorAction=[!SetOption MeterPrice1 Text "Error obtaining data from binance!"]
UpdateDivider=5
[MeasurePrice1]
Measure=WebParser
URL=[MeasureBinancePriceData1]
StringIndex=2
IfAboveValue=#LastPriceTradeSymbol1#
IfAboveAction=[!SetOption MeterTL4 FontColor #UpCol#][!SetOption MeterPrice1 Text ""][!SetVariable LastPriceTradeSymbol1 [MeasurePrice1]]
IfBelowValue=#LastPriceTradeSymbol1#
IfBelowAction=[!SetOption MeterTL4 FontColor #DownCol#][!SetOption MeterPrice1 Text ""][!SetVariable LastPriceTradeSymbol1 [MeasurePrice1]]
DynamicVariables=1
OnConnectErrorAction=[!SetOption MeterPrice1 Text "Error obtaining data from binance!"]
;Truncation
RegExpSubstitute=1
Substitute="(.*\.\d{2})\d*":"\1"
UpdateDivider=5
;---------- BINANCE API TRADESYMBOL 2 ----------
[MeasureBinancePriceData2]
Measure=WebParser
URL=https://api.binance.com/api/v3/ticker/24hr?symbol=#TradeSymbol2#
UpdateRate=2
RegExp=(?siU)"priceChangePercent":"(.*)","weightedAvgPrice":".*","prevClosePrice":".*","lastPrice":"(.*)"
OnConnectErrorAction=[!SetOption MeterPrice2 Text "Error obtaining data from binance!"]
UpdateDivider=5
[MeasurePrice2]
Measure=WebParser
URL=[MeasureBinancePriceData2]
StringIndex=2
IfAboveValue=#LastPriceTradeSymbol2#
IfAboveAction=[!SetOption MeterTL3 FontColor #UpCol#][!SetOption MeterPrice2 Text ""][!SetVariable LastPriceTradeSymbol2 [MeasurePrice2]]
IfBelowValue=#LastPriceTradeSymbol2#
IfBelowAction=[!SetOption MeterTL3 FontColor #DownCol#][!SetOption MeterPrice2 Text ""][!SetVariable LastPriceTradeSymbol2 [MeasurePrice2]]
DynamicVariables=1
OnConnectErrorAction=[!SetOption MeterPrice2 Text "Error obtaining data from binance!"]
RegExpSubstitute=1
Substitute="(.*\.\d{4})\d*":"\1"
UpdateDivider=5
[MeasureBinancePriceData3]
Measure=WebParser
URL=https://api.binance.com/api/v3/ticker/24hr?symbol=#TradeSymbol3#
UpdateRate=2
RegExp=(?siU)"priceChangePercent":"(.*)","weightedAvgPrice":".*","prevClosePrice":".*","lastPrice":"(.*)"
OnConnectErrorAction=[!SetOption MeterPrice2 Text "Error obtaining data from binance!"]
UpdateDivider=5
[MeasurePrice3]
Measure=WebParser
URL=[MeasureBinancePriceData3]
StringIndex=2
IfAboveValue=#LastPriceTradeSymbol3#
IfAboveAction=[!SetOption MeterTL2 FontColor #UpCol#][!SetOption MeterPrice3 Text ""][!SetVariable LastPriceTradeSymbol3 [MeasurePrice3]]
IfBelowValue=#LastPriceTradeSymbol3#
IfBelowAction=[!SetOption MeterTL2 FontColor #DownCol#][!SetOption MeterPrice3 Text ""][!SetVariable LastPriceTradeSymbol3 [MeasurePrice3]]
DynamicVariables=1
OnConnectErrorAction=[!SetOption MeterPrice3 Text "Error obtaining data from binance!"]
RegExpSubstitute=1
Substitute="(.*\.\d{3})\d*":"\1"
UpdateDivider=5
;================================================
[MeterSymbolLabel1]
Meter=String
Text=BTC
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
FontSize=#TextSize#
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
StringStyle=Bold
StringAlign=Right
X=320
Y=-1
[MeterPrice1]
Meter=String
Text=Getting Price...
MeasureName=MeasurePrice1
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
FontSize=#TextSize#
NumOfDecimals=4
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
StringStyle=Bold
StringAlign=Right
DynamicVariables=1
X=424
Y=-1
;---------- METER 2 ----------
[MeterSymbolLabel2]
DynamicVariables=1
Meter=String
Text=ADA
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
FontSize=#TextSize#
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
StringStyle=Bold
StringAlign=Right
X=328
Y=19
[MeterPrice2]
Meter=String
Text=Getting Price...
MeasureName=MeasurePrice2
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
FontSize=#TextSize#
StringStyle=Bold
StringAlign=Right
NumOfDecimals=4
DynamicVariables=1
X=424
Y=19
[MeterSymbolLabel3]
DynamicVariables=1
Meter=String
Text=USD
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
FontSize=#TextSize#
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
StringStyle=Bold
StringAlign=Right
X=326
Y=39
[MeterPrice3]
Meter=String
Text=Getting Price...
MeasureName=MeasurePrice3
AntiAlias=1
FontFace=Calibri CAPS
FontColor=255,255,255
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
FontSize=#TextSize#
StringStyle=Bold
StringAlign=Right
NumOfDecimals=4
DynamicVariables=1
X=424
Y=39
[MeterTL4]
Meter=STRING
MeasureName=MeasurePrice1
X=438
Y=-1
FontSize=#TextSize#
FontColor=#TextCol#
StringAlign=right
StringStyle=Bold
FontFace=Ubuntu
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
Antialias=1
Text="$"
DynamicVariables=1
[MeterTL3]
Meter=STRING
MeasureName=MeasurePrice2
X=438
Y=20
FontSize=#TextSize#
FontColor=#TextCol#
StringAlign=right
StringStyle=Bold
FontFace=Ubuntu
StringEffect=SHADOW
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
Antialias=1
Text="$"
DynamicVariables=1
[MeterTL2]
Meter=STRING
MeasureName=MeasurePrice3
X=441
Y=46
FontSize=13
FontColor=#TextCol#
StringAlign=right
;StringStyle=Bold
FontFace=Ubuntu
StringEffect=SHADOW
Antialias=1
InlineSetting=Face | IcoFont
InlinePattern=[\xea1e]
InlineSetting=Shadow | 0 | 0 | 1.5 | 0,0,0
Text=[\xea1e]
DynamicVariables=1