Symbol leverage
Symbol leverage
17 Jul 2015, 17:57
I am working on developing a multi-symbol cBot and have encountered a deficiency within the cAlgo.API. All of the trades made within the cBot are based upon a per-defined percentage of the account balance being used when the position is opened, in order to achieve this the cBot needs to know the leverage for a given symbol. Using the account leverage works as long as this is the same as the broker has defined for the symbol.
long volume = Symbol.NormalizeVolume(Account.Balance * RiskPercentage * Account.Leverage), RoundingMode.ToNearest);
However certain symbols are set to use a different maximum leverage, which negates the above calculation meaning that the margin of the position is either much higher or lower than expected. Could you please extend the Symbol class to include the leverage specific to that symbol, e.g.
var x = Symbol.Leverage;
At present I am having to work around this problem by either hard-coding the leverage values for each symbol, or using a file which is read upon startup, neither of which account for changes made by brokers.
Replies
... Deleted by UFO ...
Spotware
20 Jul 2015, 06:30
Dear Trader,
Thank you for your suggestion. We will consider it. Additionally you can post your ideas/suggestions to http://vote.spotware.com/
@Spotware