Topics
Replies
Tj11
22 Apr 2020, 11:28
RE:
PanagiotisCharalampous said:
Hi Tj11,
Are you using the same workspace on all instances? If yes, then these changes will be synchronized. Chart configuration is saved in workspaces. If you wish to have a different configuration per instance then you need to use a different workspace as well
Best Regards,
Panagiotis
Panagiotis,
I was working under the same workspace on one PC.
Updated now, thanks a lot !
Regards, Tj
@Tj11
Tj11
21 Apr 2020, 14:13
RE:
PanagiotisCharalampous said:
Hi Tj11,
Why do you thing your question is being ignored? It was just posted today. We need more information about the issue. Can you provide us with steps to reproduce this behavior?
Best Regards,
Panagiotis
Dear Panagiotis,
I respect you. Your kindness is great !
I have never seen such helpfullness from support that I saw you do.
.
The issue example steps :
1. Open cTrader Desktop, set multiple profiles and add 3 new profiles.
2. Open each of them on new cTrader launches.
3. Create different number of charts on each cTrader. Add different chart objects on different cTraders.
4. Close all cTraders.
5. Open all three cTraders. If i understand right, each cTrader should preserve unique chart numbers and unique chart elements added in step 3.
The issue : all cTraders will be the same. Chart settings are not preserved on each profile as promised.
@Tj11
Tj11
13 Apr 2020, 14:24
RE:
PanagiotisCharalampous said:
Hi Tj11,
Can you please explain to us what is the problem?
Best Regards,
Panagiotis
Hi Panagiotis,
Sorry for such a post. Screen shows detached chart. AUDUSD was not loading for several minutes... I run my tool (as indicator) on that chart and also cBot on the back is running on AUDUSD as well. Maybe it's lagging was related to my tools, I don't know.
Anyways, I don't expect you to solve it, just posted. Sorry for confusion.
Regards, Tj
@Tj11
Tj11
09 Apr 2020, 14:56
Last version from me :
.
public int getVolume(double StopLoss, bool upper)
{
//entry in cash
double riskPerTrade = (Account.Balance * EntryPercentage) / 100;
//pips
double stop = (Symbol.PipSize == Symbol.TickSize) ? StopLoss * Math.Pow(10, Symbol.Digits) : StopLoss * Math.Pow(10, Symbol.Digits - 1);
double commission = Commission / 10;
double spread = (Symbol.PipSize == Symbol.TickSize) ? Symbol.Spread * Math.Pow(10, Symbol.Digits) : Symbol.Spread * Math.Pow(10, Symbol.Digits - 1);
double totalPips = stop + spread;
//Print("totalPips ", totalPips, " stop ", stop, " commission ", commission, " upper ", upper, " spread ", spread);
//exact volume to trade
double exactVolume = riskPerTrade / (Symbol.PipValue * totalPips);
//account for comission properly
int count = 0;
double diff = 1;
double corrdVolume = exactVolume;
while (diff > 0.01 && count < 10)
{
//comission in cash
double _commission = (Symbol.Name == "XTIUSD" || Symbol.Name == "XBRUSD") ? Commission / 50 : Commission;
double cashComm = corrdVolume * _commission / Symbol.LotSize;
double cashStop = corrdVolume * Symbol.PipValue * totalPips;
double loss = cashStop + cashComm;
//Print("loss ", Math.Round(loss), " cashStop ", Math.Round(cashStop), " cashComm ", Math.Round(cashComm, 2));
diff = Math.Abs(loss / riskPerTrade - 1);
//correction
if (diff > 0.01)
{
double diffCash = riskPerTrade - loss;
double diffVolume = diffCash / (Symbol.PipValue * (totalPips + commission));
corrdVolume = corrdVolume + diffVolume;
//Print("Interm corrdVolume ", Math.Round(corrdVolume), " diffVolume ", Math.Round(diffVolume), " exactVolume ", Math.Round(exactVolume), " diffCash ", Math.Round(diffCash), " diff ", Math.Round(diff, 3), " count ", count, " loss ", Math.Round(loss), " riskPerTrade ", Math.Round(riskPerTrade));
}
else
{
//Print("Final corrdVolume ", Math.Round(corrdVolume), " exactVolume ", Math.Round(exactVolume), " diff ", Math.Round(diff, 3), " count ", count, " loss ", Math.Round(loss), " riskPerTrade ", Math.Round(riskPerTrade));
}
count++;
}
//normalize the volume
double normVolume = Symbol.NormalizeVolumeInUnits(corrdVolume, RoundingMode.ToNearest);
//make sure volume within accepted range
double accVolume = (normVolume < Symbol.VolumeInUnitsMin) ? Symbol.VolumeInUnitsMin : (normVolume > Symbol.VolumeInUnitsMax) ? Symbol.VolumeInUnitsMax : normVolume;
//get volume
int volume = (int)accVolume;
//Symbol.QuantityToVolumeInUnits(lot);
//Print("LotSize ", Symbol.LotSize, " PipSize ", Symbol.PipSize, " PipValue ", Symbol.PipValue, " TickSize ", Symbol.TickSize, " TickValue ", Symbol.TickValue, " VolumeInUnitsStep ", Symbol.VolumeInUnitsStep);
//Print("volume ", volume, " accVolume ", accVolume, " normVolume ", normVolume, " exactVolume ", exactVolume, " riskPerTrade ", riskPerTrade, " totalPips ", totalPips, " stop ", stop, " comission ", commission, " spread ", spread, " Symbol.LotSize ", Symbol.LotSize);
return volume;
//source : https://ctrader.com/forum/cbot-support/1573?page=1
}
.
cheers
@Tj11
Tj11
02 Apr 2020, 14:02
small add to make units right :
.
//entry in cash
double riskPerTrade = (Account.Balance * EntryPercentage) / 100;
//pips
double stop = StopLoss * Math.Pow(10, Symbol.Digits - 1);
double comission = Commission / 10;
double spread = Symbol.Spread * Math.Pow(10, Symbol.Digits - 1);
double totalPips = stop + comission + spread;
//exact volume to trade
double exactVolume = Math.Round(riskPerTrade / (Symbol.PipValue * totalPips), 2);
//round volume to 0.01 lot
int volume = (((int)exactVolume) / 1000) * 1000;
//make sure min volume used
volume = (volume < 1000) ? 1000 : volume;
@Tj11
Tj11
17 Mar 2020, 14:42
( Updated at: 21 Dec 2023, 09:21 )
RE:
PanagiotisCharalampous said:
Hi Tj11,
When typing a method in cTrader code editor or Visual Studio, Intellisense will tell you which paramerers are required
You need to remove the Slippage parameter. If you need a market range order, use ExecuteMarketRangeOrder() method.
Best Regards,
Panagiotis
Dear Panagiotis,
Thank you a lot for fast and kind answer, it worked well.
.
As a side note, ExecuteMarketRangeOrder could be added here : https://help.ctrader.com/ctrader-automate/guides/trading_api .
.
Thanks a lot again !!!
@Tj11
Tj11
09 Mar 2020, 16:56
RE:
PanagiotisCharalampous said:
Hi Tj11,
Green and Red arrows indicate deposits and withdrawals respectively. See the legend.
Best Regards,
Panagiotis
Panagiotis,
Sorry for beeing indirect. I wanted to say that the risk assosiated to copy the signal is hidden or not clear.
Adding : local max balance - local min equity + withdrawal - deposit = balance-equity drawdown
would make Copy transparent for investors.
Cheers
@Tj11
Tj11
09 Mar 2020, 15:55
( Updated at: 21 Dec 2023, 09:21 )
RE:
Tj11 said:
Panagiotis,
This is screenshot from "Relax" signal in cTrader Copy.
What does Min Equity mean on red arrow 0.15$ ?
Does it mean that investors burned ?
And at the same time maximal balance dd is 20%.
Or does it mean that he withdraw 553$ and then deposit back 300$ ? Looks like this is the case.....
@Tj11
Tj11
02 Jul 2020, 15:11
RE:
PanagiotisCharalampous said:
Didn't understand what backlog means. But hopefully they will ba added.
Cheers.
@Tj11