Topics
Replies
PanagiotisCharalampous
14 Nov 2024, 09:31
Hi all,
Just use an external IDE for development. You can do this with a click of a button and get all the development functionalities you need. The built in editor is appropriate only for simple projects.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Nov 2024, 07:02
RE: RE: Impossible to save charts models
f3nryll said:
PanagiotisCharalampous said:
Hi there,
Can you record a video demonstrating what exactly is happening?
Best regards,
Panagiotis
https://drive.google.com/file/d/14eP04mOEHZhxJ0Shv4MKpJvKFv3rxAt1/view?usp=drive_link
Hi there,
Thank you. The product team will investigate this issue and resolve it in an upcoming update.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Nov 2024, 06:48
Hi there,
The entry price of the position is the average entry price of the deals composing the position. If the position has only one opening deal, then the opening price should not change. If more opening deals are involved e.g. you have increased the size of the position after entering it, the entry price might change as partial volume is closed and deals removed from the position.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Nov 2024, 06:41
Hi there,
I don't think you can install cMAM on Linux.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 12:23
RE: RE: cBot that references several Renko periods
ene.andrei.plc said:
PanagiotisCharalampous said:
Hi mariusgunnerud,
It is on the roadmap but we do not have at ETA at the moment.
Best Regards,
Panagiotis
Hi Panos,
Apologies if this is available elsewhere, but has this been added to cTrader? Having issues finding it in the KB.
Regards,
Andrei
Hi Andrei,
Yes, renko charts are available in backtesting
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 12:21
RE: RE: RE: Error | CBot instance crashed with error #ED2F94F3.
samyelzallat said:
PanagiotisCharalampous said:
samyelzallat said:
when I remove onbarclosed from the bot and use onbar it doesn't cause an error
Hi there,
Please provide the complete cBot code
Best regards,
Panagiotis
using cAlgo.API;using cAlgo.API.Collections;using cAlgo.API.Indicators;using cAlgo.API.Internals;using cAlgo.Indicators;using Microsoft.VisualBasic;using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;namespace cAlgo.Robots { [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class WaveRider: Robot { [Parameter("Trade Volume (in units)", DefaultValue = 2000, MinValue = 2000, Step = 2000)] public double TradeVolume { get; set; } [Parameter("Partial Take Profit (in units)", DefaultValue = 1000, MinValue = 1000, Step = 1000)] public double VolumeToClose { get; set; } [Parameter("ATR Period", Group = "ATR", DefaultValue = 20)] public int AtrPeriod { get; set; } [Parameter("ATR MA Type", Group = "ATR", DefaultValue = MovingAverageType.Simple)] public MovingAverageType AtrMa { get; set; } private AverageTrueRange atr; [Parameter("First Source", DefaultValue = "Open", Group = "Moving Averages")] public DataSeries OpenSmaSource { get; set; } [Parameter("Second Source", DefaultValue = "Close", Group = "Moving Averages")] public DataSeries CloseSmaSource { get; set; } [Parameter("SMA Period", Group = "Moving Averages", DefaultValue = 20)] public int SmaPeriod { get; set; } [Parameter("SMA Period", Group = "Moving Averages", DefaultValue = 100)] public int Sma2Period { get; set; } private SimpleMovingAverage OpenSma; private SimpleMovingAverage CloseSma; private SimpleMovingAverage BiggerSma; private const string myComment = "Trendat"; private bool FirstTradeActive = false; private bool IsItLong = false; private bool IsItShort = false; private bool ModifiedOnce = false; private bool ModifiedTwice = false; private bool MultipleTrades = false; private bool GridStopped = false; private bool StepOne = false; private bool StepTwo = false; private bool GridStopLossSet = false; private double MultiplierReference = 0; private double GlobalAtrThreshold; private double GlobalFirstEntry; private double GlobalExitProfit; private double GlobalExitMeasure; private double GlobalGrid; private double GridSl; double GridModifiedSL; private double LotsTraded = 0; protected override void OnStart() { atr = Indicators.AverageTrueRange(AtrPeriod, AtrMa); OpenSma = Indicators.SimpleMovingAverage(OpenSmaSource, SmaPeriod); CloseSma = Indicators.SimpleMovingAverage(CloseSmaSource, SmaPeriod); BiggerSma = Indicators.SimpleMovingAverage(CloseSmaSource, Sma2Period); } protected override void OnBarClosed() { double closingPrice = Bars.ClosePrices.Last(1); double openingPrice = Bars.OpenPrices.Last(1); double closingPrice2ago = Bars.ClosePrices.Last(2); double openingPrice2ago = Bars.OpenPrices.Last(2); double closingPrice3ago = Bars.ClosePrices.Last(3); double openingPrice3ago = Bars.OpenPrices.Last(3); double closingPrice4ago = Bars.ClosePrices.Last(4); double openingPrice4ago = Bars.OpenPrices.Last(4); double closingPrice5ago = Bars.ClosePrices.Last(5); double openingPrice5ago = Bars.OpenPrices.Last(5); double closingPrice6ago = Bars.ClosePrices.Last(6); double openingPrice6ago = Bars.OpenPrices.Last(6); double closingPrice7ago = Bars.ClosePrices.Last(7); double openingPrice7ago = Bars.OpenPrices.Last(7); double closingPrice8ago = Bars.ClosePrices.Last(8); double openingPrice8ago = Bars.OpenPrices.Last(8); double closingPrice9ago = Bars.ClosePrices.Last(9); double openingPrice9ago = Bars.OpenPrices.Last(9); double closingPrice10ago = Bars.ClosePrices.Last(10); double openingPrice10ago = Bars.OpenPrices.Last(10); double OpenSmaLast = OpenSma.Result.Last(1); double OpenSma3Ago = OpenSma.Result.Last(3); double CloseSmaLast = CloseSma.Result.Last(1); double CloseSma3Ago = CloseSma.Result.Last(3); double BiggerSmaLast = BiggerSma.Result.Last(1); bool BuySignal = CloseSmaLast > OpenSmaLast && OpenSmaLast > BiggerSmaLast && openingPrice3ago < OpenSma3Ago && closingPrice3ago > CloseSma3Ago && closingPrice2ago > openingPrice2ago && closingPrice > openingPrice; bool SellSignal = CloseSmaLast < OpenSmaLast && CloseSmaLast < BiggerSmaLast && openingPrice3ago > OpenSma3Ago && closingPrice3ago < CloseSma3Ago && closingPrice2ago < openingPrice2ago && closingPrice < openingPrice; double GridRange = Math.Abs(closingPrice2ago - openingPrice8ago); double DistanceFromEntry = Math.Abs(GlobalFirstEntry - closingPrice); int DistanceMultipled = 0; if (GlobalGrid != 0) { DistanceMultipled = (int) Math.Floor(DistanceFromEntry / GlobalGrid); } double SpreadAtr = Math.Round(atr.Result.Last(1) / Symbol.PipSize, 4); double StopLossAtr = Math.Round(GridRange / Symbol.PipSize, 4) * 4; double spread = Symbol.Spread / Symbol.PipSize; double MultipleTradesMeasure = atr.Result.Last(1); double MultipleTradesAtr = Math.Round((atr.Result.Last(1)) / Symbol.PipSize, 4); GlobalExitProfit = MultipleTradesAtr; GlobalExitMeasure = MultipleTradesMeasure; var HourlyTf = MarketData.GetBars(TimeFrame.Hour); double HrlyOpening = HourlyTf.OpenPrices.Last(0); double HrlyHigh = HourlyTf.HighPrices.Last(0); double HrlyLow = HourlyTf.LowPrices.Last(0); double HrlyOpening2Ago = HourlyTf.OpenPrices.Last(1); double HrlyClosing2Ago = HourlyTf.ClosePrices.Last(1); double HrlyHigh2Ago = HourlyTf.HighPrices.Last(1); double HrlyLow2Ago = HourlyTf.LowPrices.Last(1); double HrlyOpening3Ago = HourlyTf.OpenPrices.Last(2); double HrlyClosing3Ago = HourlyTf.ClosePrices.Last(2); double HrlyCandleBody = Math.Abs(HrlyOpening2Ago - HrlyClosing2Ago); double HrlyUpperWick; double HrlyLowerWick; bool PossibleReverse = false; if (HrlyClosing2Ago > HrlyOpening2Ago) { HrlyUpperWick = HrlyHigh2Ago - HrlyClosing2Ago; HrlyLowerWick = HrlyOpening2Ago - HrlyLow2Ago; if (HrlyUpperWick >= 0.4 * HrlyCandleBody) { PossibleReverse = true; } } else if (HrlyClosing2Ago < HrlyOpening2Ago) { HrlyUpperWick = HrlyHigh2Ago - HrlyOpening2Ago; HrlyLowerWick = HrlyClosing2Ago - HrlyLow2Ago; if (HrlyLowerWick >= 0.4 * HrlyCandleBody) { PossibleReverse = true; } } bool BullishHr = HrlyClosing2Ago > HrlyOpening2Ago && HrlyClosing3Ago > HrlyOpening3Ago; bool BearishHr = HrlyClosing2Ago < HrlyOpening2Ago && HrlyClosing3Ago < HrlyOpening3Ago; if (DistanceMultipled > MultiplierReference && !ModifiedOnce && !GridStopped && (IsItLong || IsItShort)) { MultiplierReference = DistanceMultipled; MultipleTrades = true; TradeType tradeType = IsItLong ? TradeType.Buy : TradeType.Sell; ExecuteMarketOrder(tradeType, SymbolName, TradeVolume, MultiplierReference.ToString(), GridSl, null, myComment); LotsTraded += 0.01; } if (FirstTradeActive) { return; } if (BuySignal && spread <= .9 && spread < SpreadAtr) { ExecuteMarketOrder(TradeType.Buy, SymbolName, TradeVolume, "First Buy", StopLossAtr, null, myComment); IsItLong = true; FirstTradeActive = true; GlobalFirstEntry = Symbol.Ask; GlobalAtrThreshold = atr.Result.Last(1); GlobalGrid = GridRange; GridSl = StopLossAtr; LotsTraded += 0.01; } else if (SellSignal && spread <= .9 && spread < SpreadAtr) { ExecuteMarketOrder(TradeType.Sell, SymbolName, TradeVolume, "First Sell", StopLossAtr, null, myComment); IsItShort = true; FirstTradeActive = true; GlobalFirstEntry = Symbol.Bid; GlobalAtrThreshold = atr.Result.Last(1); GlobalGrid = GridRange; GridSl = StopLossAtr; LotsTraded += 0.01; } }
this will crash until you replace OnBarClosed with OnBar, which I did to have it work
also works with 1hr tf correctly, and it crashes with both fp markets and fusion markets accounts
Thank you. This issue will be fixed in an upcoming update.
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 10:41
RE: FontFamily in Button Text?
ctid5996231 said:
@Panagiotis?
Hi there,
It looks like a bug. The team will investigate and resolve in an upcoming update.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 07:42
RE: RE: RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
kaxalope said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
kaxalope said:
PanagiotisCharalampous said:
Hi there,
Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.
Best regards,
Panagiotis
I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.
No it is not possible, however you can reference shared projects across many solutions, if this is what you are looking for.
Best regards,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
Hi there,
It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit.
What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.
Best regards,
Panagiotis
No, a cTrader bot/plugin/indicator is not a project but a solution. This is the reason for the topic.
I don't see the problem. In .Net, you can reference projects that are parts of solutions in other solutions. This is not a cTrader thing, is a .Net thing. So you can have an indicator as a standalone solution, as well as reference it in other solutions i.e cBots or plugins
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 07:12
RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
serge.owonaokoa said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
kaxalope said:
PanagiotisCharalampous said:
Hi there,
Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.
Best regards,
Panagiotis
I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.
No it is not possible, however you can reference shared projects across many solutions, if this is what you are looking for.
Best regards,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
Hi there,
It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit.
What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 06:38
Hi there,
Can you record a video demonstrating what exactly is happening?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 06:35
RE: RE: RE: RE: Custom indicator Plotting horizontal lines at User specified price increments
SaphirSpecs said:
PanagiotisCharalampous said:
SaphirSpecs said:
PanagiotisCharalampous said:
so I’m not really fam with coding on this platform and currently the code does plot horizontal lines on the workspace.
the ideal output is-user defines (current) price at which the algo starts plotting horizontal lines
-user defines increment at which each horizontal line is plotted
for example ( Gold 2000, 3, 100)
algo plots a horizontal line each $3
currently my code gives me the prompts for each parameter but does not even plot a single line.
ideally the code would plot automatically using a for loop. But worst case scenario I can manually enter the code for each lineHi there,
Can you explain your issue in more detail? What do you expect your code to do and what does it do instead?
Best regards,
Panagiotis
Hi there,
I tried your indicator and it plots the lines fine.
So I do not see a problem.
Best regards,
Hey there,
Thanks for trying out the code. However the issue is that it's not supposed to just plot one line. It supposed to plot multiple lines as defined by the User. Could you share the code you used to get it to plot a line ? Cause I was not able able able to get my code to plot a single line.
Thank you in advance.
Hi there,
I used the code you shared. If you want to plot several lines, you need to write the relevant code i.e. a for loop where you will plot lines at different increments.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 06:33
RE: Error | CBot instance crashed with error #ED2F94F3.
samyelzallat said:
when I remove onbarclosed from the bot and use onbar it doesn't cause an error
Hi there,
Please provide the complete cBot code
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Nov 2024, 06:31
Hi there,
It looks like the dll is missing from your computer. Can you please advise the reference you use for the System.Drawing methods? The methods do not seem to be a part of the standard System.Drawing namespace
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 13:55
RE: RE: Memory Manager bot
dejonge4 said:
PanagiotisCharalampous said:
Hi there,
Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
Best regards,
Panagiotis
Hopefully you received the text as per the above instructions. The happens every time I try to Optimize a trading bot. The first pic is my % of free RAM before Optimization begins and the second pic is after 4 minutes of Optimization.
Thank you. Unfortunately troubleshooting does not provide any useful information. It it possible to run dotMemory and provide us with a memory snapshot?
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 13:51
RE: RE: Why is backtesting SO slow after the update? yesterday it was fine before I updated and now my cBot is ultra slow
Elon.Musk said:
PanagiotisCharalampous said:
Hi there,
Can you share your cBot code so that we can reproduce the issue?
Best regards,
Panagiotis
hi @PanagiotisCharalampous .. the new Ctraders versions are extremly slow with optimization .. what used to optimize in 15 mins is now taking 1 hour if not up to 3 hours !!! this is rendering the Ctrader really unusable for lots of algo traders .. what is the plan to enhance optimization performance !
Hi there,
Improvements related to this thread will be released in 5.1.0
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 11:19
RE: RE: RE: RE: cTrader web NOT usable lately!!
RobinRaePhoto said:
PanagiotisCharalampous said:
RobinRaePhoto said:
PanagiotisCharalampous said:
Hi there,
Thank you for reporting this issue. Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
Best regards,
Panagiotis
Thank you for your response. The video instruction did not show how to access the “troubleshooting” submission box. I finally figured out how to access it. I just submitted the troubleshooting information, including the link to this discussion. How will I hear back about this?
Hi there,
The high memory usage in the browser may be due to a video card issue, which sometimes requires a computer restart to restore performance.
Please restart your Mac and check if your setup meets the minimum system requirements for cTrader. You can review them here: cTrader System Requirements.
If the issue persists, please wait for the next cTrader release, where we are working on fixing any potential issues.
Best regards,
Panagiotis
I forgot to mention in my last reply … I also tried using cTrader platform on Safari and Google Chrome. The problem also happens on both of those browsers, so it is not the browser. It is something in the application of the cTrader Web platform. As I said, I have been using cTrader Web for 2 years with no problems. This issue just began about a month ago.
Hi there,
Any chance you can try another device as well and let us know if the issue persists?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 06:45
Hi there,
Because limit orders are always executed at the trigger price or better. On the contrary, stop orders are just market orders.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 06:43
RE: RE: ChartTrendLines don't get removed from OnDestroy() method when indicator removed from chart
firemyst said:
PanagiotisCharalampous said:
Hi firemyst,
Thank you for reporting this. We are investigating.
Best regards,
Panagiotis
Any updates on this? Were they able to reproduce the issue?
Yes, it will be fixed in an upcoming update
@PanagiotisCharalampous
PanagiotisCharalampous
12 Nov 2024, 06:40
RE: Trading for this account is disabled. Trading for this symbol is currently disabled.
sumarasarjil said:
I am showing disabled symbols on my desktop and I am not able to place any trade, is there any solution for this, please help me fast.
Please talk to your broker
@PanagiotisCharalampous
PanagiotisCharalampous
14 Nov 2024, 14:23
RE: RE: The ability To Copy And Paste Build Errors & Results for code debugging. (Mind Numbingly Infuriating)
Enivid said:
They can do that in an IDE. The product team will not divert resources from other important features to build something that already exists and can be used immediately.
@PanagiotisCharalampous