Default position size keeps jumping to 1.00 lots for FX and 10.00 on XAU/USD after the restart of ctrader and the opening of a new Symbol. This only happens on the chart trader but on the symbol window it stays 0.01.
Just add a setting where we can pick a standard default size on the platform.
Where is the last picked lot size saved?
I’m using c trader for more than three years. I’m trading spot index S&P 500.
My default trade is one unit and then I use edit to make it five up to 10 to avoid any accidentally error
As usual lust night I was trying to open Sale position. I clicked the sale butty then I was shocked that the lot size was 500 units with almost value of $ 2.85 million an account killer. I immediately closed it and lost $3000 In 24 seconds . I’m wondering what could happen if I didn’t notice the lot size.
I contacted Fxpro to solve this problem and still I’m waiting for a reply
Also actively looking for this solution. I have also tried to look for API methods I could use to implement this on my own — but it's not possible.
It's not a trivial feature ask. All major platforms available on the market (MT4/5, TradingView, QuanTower, …) have the ability to fix scale because it is a higly useful feature.
One thin i dont understand is why implementations take such time and clients have replies as we dont.
Well you should think like this.
People use this tools to make money if anything risks them to lose it change it to dump it.
And ive seen loads of posts pointing towards rather irritating matters that could potentially risk a trade due to example bad visibility wrong settings ranges limites customisabillity.
I Suggest plattform developers try to keep pace listen more work more.
Becouse python accomplishes everything clients wish for trough api algo trading company services.
For gods sake the youth are even making their own bots and indis on it.
If anything else turn of the limitations on the plattforms so the clients can use it freely.,
Its the clients money its the clients that choose how to use it.
You cannot use the Print method inside the ClassLibrary since it does not have access to the log. You should rewrite your code so that the message printing takes place inside the main cBot.
You can also remove the class that is no longer needed now:
(...)
Thank you! Sorry for bugging but I still need some adjustment for indices. I get wrong results (they are 10x too big) for GER40 or US100. Methods name have changed but the code inside is the same as yours.
I added another variant for 2 digits:
switch (cBot.Symbol.Digits)
{
case 2:
multy = 1000;
break;
case 3:
multy = 0.1;
break;
case 4:
case 5:
multy = 10;
break;
}
But now XAUUSD is broken (gives 10x to small result). Is there a way to do this properly or I should make adjustments for each symbol (sound quite insane)?
Nevertheless your example still gives me different values. See screenshot (backtesting) below based on copy/paste of your code to new cBot with just ExecuteMarketOrder added;
I am not sure I understand what you mean but I will try to answer with a concrete example and maybe start from this example to better understand what you need:
using cAlgo.API;using cAlgo.API.Internals;using System;namespace cAlgo.Robots{ [Robot(AccessRights = AccessRights.None)] public class TradesRisky : Robot { class Risky { public double Pips { get; set; } public double Commissions { get; set; } } protected override void OnStart() { Positions.Modified += OnPositionModified; UpdateData(); } protected override void OnTick() { UpdateData(); } public void OnPositionModified(PositionModifiedEventArgs args) { UpdateData(); } private void UpdateData() { Risky MyRisky = GetTotalPipsRisky(); double MoneyRisky = GetPipValueInMoney(MyRisky.Pips); Chart.DrawStaticText("Risky", string.Format("You are risking {0} pips for a total value of {1} {2} and {3} {2} commissions.", MyRisky.Pips, MoneyRisky, Account.Asset, MyRisky.Commissions), VerticalAlignment.Top, HorizontalAlignment.Left, Color.Red ); } // This function can be improved private double GetPipValueInMoney(double pips) { return Math.Round(pips * Symbol.PipValue / ( Symbol.PipSize * 100), 2); } private Risky GetTotalPipsRisky() { double pips = 0; double commissions = 0; Position[] MyPositions = Positions.FindAll(null, SymbolName); foreach (Position position in Positions) { if (position.StopLoss != null && position.StopLoss > 0) pips += Math.Abs((double)position.StopLoss - position.EntryPrice); commissions += position.Commissions; } return new Risky { Pips = DigitsToPips(pips), Commissions = commissions }; } private double DigitsToPips(double pips) { return Math.Round(pips / Symbol.PipSize, 2); } }}
ChrisSpire
22 Dec 2024, 19:08 ( Updated at: 23 Dec 2024, 08:01 )
RE: RE: Default lot size on opening a window
You can try a simple but efficient panel for opening positions. Let's you use margin % or fixed lot size: https://ctrader.com/products/294
boss.imax.09 said:
@ChrisSpire