What is type double?
What is type double?
19 Jan 2021, 18:33
When assigning a position's stoploss or takeprofit to a double I need to convert it to a double because they are type "double?". Entry price is type "double" (without a ? at the end).
Not sure why, any ideas?
Replies
firemyst
20 Jan 2021, 08:07
It's a nullable type.
Anytype in C# that ends in a "?" is a nullable type.
This basically only applies to primitive types though, because objects (such as strings) are inherently nullable.
So a type of int? means it's nullable whereas a type of just plain int is not.
int x = 16 is fine.
int? x = 16 is fine.
int? x = null is fine.
int x = null is not fine.
@firemyst
prosteel1
20 Jan 2021, 08:37
RE:
Bots4Us said:
Hi prosteel1,
The EntryPrice cannot be null. By contrast, the Take Profit is in the above. A double cannot be nulled.
https://ctrader.com/forum/calgo-support/7806#post-2Bots4Us
Thanks!
@prosteel1
Bots4Us
20 Jan 2021, 01:08
Hi prosteel1,
The EntryPrice cannot be null. By contrast, the Take Profit is in the above. A double cannot be nulled.
https://ctrader.com/forum/calgo-support/7806#post-2
Bots4Us
@Bots4Us