System.Security.SecurityException using a LINQ query

12 Aug 2017, 19:26System.Security.SecurityException using a LINQ query#1
nmaxcomposts: 9since: 23 May 2016

I'm aware that using FullAccess rights will get rid of this exception. But it seems like an overkill to me: I'm not reading any local files, connecting to the internet or otherwise.

I'm just using (for example):

Positions.OrderByDescending(x => x.GrossProfit).Last()

What kind of rights am I violating with this? What's the most restrictive AccessRights I can set to be able to use this?

Thanks.

15 Aug 2017, 16:26#2
Paul_Hayesposts: 241since: 05 Feb 2015

I see your question has not been answered yet, so I created a new cBot with no AccessRights and ran the code below in the OnStart method.

var positions = Positions.OrderByDescending(x => x.GrossProfit).Last();

The line of code executed fine, your problem may be in another code block somewhere.


www.clickalgo.com
16 Aug 2017, 11:58#3
Spotwareposts: 3274since: 23 Sep 2013

Dear nmaxcom,

Indeed we cannot reproduce your issue. Can you please provide a cBot that reproduces the exception so we can investigate further?

Best Regards,

cTrader Team


TRADERS FIRST™ Vote for your favorite features: http://vote.spotware.com/