Is posible number array in parameter?

Created at 17 May 2019, 15:38
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!
LU

lukas.ourada

Joined 11.03.2019

Is posible number array in parameter?
17 May 2019, 15:38


Hi 

i need set hours acepted for trading by user.

i try make array in parameters:

 

[Parameter("acepted trade hours? (1,2,..)", DefaultValue = "14,2,8")]
public int[] AceptedHours { get; set; }

 

and check if current hour is iclude in array

int CurrentHour = Time.Hour;

            if (AceptedHours.Contains(CurrentHour))
            {
                Print("Its ok... now is " + CurrentHour+ "h ");
            }

 

but cTrader write me error "unsuported parameter type int32[]

 

where is problem? is posible use array in parametr?

 

Thanks Lukas


@lukas.ourada
Replies

PanagiotisCharalampous
17 May 2019, 15:48

Hi Lukas,

It is not possible to have an array as an input parameter. You can get the values as string and use string.Split() to make the separation into an array.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

lukas.ourada
17 May 2019, 16:11

RE:

Panagiotis Charalampous said:

Hi Lukas,

It is not possible to have an array as an input parameter. You can get the values as string and use string.Split() to make the separation into an array.

Best Regards,

Panagiotis

 

ok thank you

i try it


@lukas.ourada