Topics
Replies
albatros7
29 May 2019, 09:34
( Updated at: 21 Dec 2023, 09:21 )
RE:
Andrey Pisarev said:
Hi,
Testing manual strategies on historical data is not supported out of the box. But you can use Visual Backtesting for this. cBot can use user inputs to open/close positions or place pending orders.
cBot can get user input from UI controls created in another window as in product Ahmad suggested. Or use some built-in cTrader events.
For now, cTrader support mouse events on the chart so you can create a cBot with trading commands using the mouse clicks. Below is an example of a cBot that uses
Shift + Left Mouse Button to open a buy position.
Ctrl + LMB to open a sell position.
Alt + LMB to close all positions.[Parameter(DefaultValue = 0.1)] public double Lots { get; set; } [Parameter("StopLoss (pips)", DefaultValue = 20)] public double StopLossPips { get; set; } [Parameter("StopLoss (pips)", DefaultValue = 20)] public double TakeProfitPips { get; set; } protected override void OnStart() { var instructionsText = "Shift + LMB = Buy\nCtrl + LMB = Sell\nAlt + LMB = Close All"; Chart.DrawStaticText("instructions", instructionsText, VerticalAlignment.Top, HorizontalAlignment.Left, Chart.ColorSettings.ForegroundColor); Chart.MouseDown += OnChartMouseDown; } private void OnChartMouseDown(ChartMouseEventArgs obj) { if (obj.ShiftKey && !obj.CtrlKey && !obj.AltKey) ExecuteMarketOrder(TradeType.Buy, Symbol, Lots * Symbol.LotSize, "MouseTrading", StopLossPips, TakeProfitPips); else if (!obj.ShiftKey && obj.CtrlKey && !obj.AltKey) ExecuteMarketOrder(TradeType.Sell, Symbol, Lots * Symbol.LotSize, "MouseTrading", StopLossPips, TakeProfitPips); else if (!obj.ShiftKey && !obj.CtrlKey && obj.AltKey) Positions.ToList().ForEach(p => ClosePositionAsync(p)); }
You can see it in action on this video:
https://www.dropbox.com/s/asdijotjnr7tl02/MouseTrading.mp4?dl=0
Error to compile
@albatros7
albatros7
29 May 2019, 08:23
( Updated at: 21 Dec 2023, 09:21 )
RE:
Andrey Pisarev said:
In cTrader version 3.6 we will add a new feature called Chart Controls. Developers will be able to add UI elements on a chart like text labels, buttons, input fields, etc.
This version will be released to Spotware Public Beta in a couple of weeks.Using these UI controls it will be possible to create trading panels that will work in Visual Backtesting:
You can see this example in action here:
https://www.dropbox.com/s/tg7oje9lc6bo5r9/ChartControls.mp4?dl=0
hi, any news on the release of version 3.6?
I need to do maual backtesting
@albatros7
albatros7
21 Jun 2022, 18:09
Mean Renko & Renko tails added by default
add renko tails please
@albatros7