WebPermission request in my indicator

Created at 19 Nov 2016, 12:45
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!
CT

ctid256802

Joined 18.10.2016

WebPermission request in my indicator
19 Nov 2016, 12:45


Hello

I'm trying to implement an indicator which downloads the data from my web service using JSON calls. But when I'm performing the calls in my code I'm getting the following error:

"Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

Is there any way how I can request and obtain this permission? In regular .NET I'd do this thru 

<trust level="Full" />

But how it can be done in cAlgo?


@ctid256802
Replies

Jiri
19 Nov 2016, 14:01

Hi, you need set access rights in the indicator attribute. See the sample below.

[Indicator(AccessRights = AccessRights.Internet)]
public class SampleIndicator : Indicator

 


@Jiri

ctid256802
20 Nov 2016, 00:14

Thank you, that works!


@ctid256802