Getting the PipSize from non Chart symbol

Created at 15 Mar 2022, 10:32
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MT

MTrade12

Joined 23.11.2021

Getting the PipSize from non Chart symbol
15 Mar 2022, 10:32


Hi Guys, 

Is it possible to get the PipSize for a different symbol than the chart the cBot's running on?

I've tried SymbolInfo.PipSize but i can't figure out the syntax. i.e.

 

foreach ( var sym in sym_names)

{

Print(SymbolInfo.PipSize);

}

 

Returns the error

"Error CS0120: An object reference is required for the non-static field, method, or property 'cAlgo.API.SymbolInfo.PipSize.get'"

 

I'm sure it's because i'm not referencing an object during the call of SymboInfo.PipSize, i.e. SymbolInfo.PipSize(sym), but i don't know the correct syntax to use. 

Any advise would be appreciated


@MTrade12
Replies

amusleh
15 Mar 2022, 10:50

Hi,

You can use Symbols.GetSymbol method and then you can use the returned Symbol instance PipSize, ex: cAlgo API Reference - Symbols Interface (ctrader.com)


@amusleh