
Bart A

Info
Username: | bart1 |
Name: | Bart A |
Member since: | 03 Aug 2017 |
About
Signature
Last Algorithm Comments
@TimeframeSync: 10 Aug 2021, 19:10
Test
@SwitchSymbol: 03 Feb 2021, 18:54
New indicator with symbols and periods https://ctrader.com/algos/indicators/show/2562
@SwitchSymbol: 25 Jun 2020, 09:40
It just needs on chart location changing option. Added
@Auto Drawings: 31 Oct 2019, 09:24
Probably your broker has cTrader version 3.5. This indicator use custom UI from the new version 3.6. You can try it with Spotware cTrader https://spotware.com/beta/
Last Forum Posts
@[Instruction] Telegram notifications: 26 May 2020, 16:08
Here is a simple instruction to add Telegram notifications into your cBot or indicator.
First you need to create your own bot by chatting with BotFather in Telegram
Send /newbot and it will ask desired display name and user name for your new Telegram bot.
From the final message you need Token. Also you need to get chat ID for your new bot to send messages to you.
Go to your bot by clicking link in the final message and send some text.
To get chat ID you need to request latest updates from your bot by entering following URL in your browser: https://api.telegram.org/bot<TOKEN>/getUpdates
replace <TOKEN> placeholder with your bot token
In response you will get text where you can find chat id
Example: ..."chat":{"id":123,...
Now you have 2 required parameters to send Telegram notifications and you can create cBot or indicator to test it. Telegram messages can be send using simple HTTP request. Here is a helper class that will do it for you.
public class TelegramBot
{
public string Token { get; private set; }
public int ChatId { get; private set; }
public TelegramBot(string token, int chatId)
{
UseTls12();
Token = token;
ChatId = chatId;
}
public bool Send(string message)
{
var url = string.Format("https://api.telegram.org/bot{0}/sendMessage?chat_id={1}&text={2}", Token, ChatId, message);
var request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
var response = (System.Net.HttpWebResponse)request.GetResponse();
return response.StatusCode == System.Net.HttpStatusCode.OK;
}
public bool Send(string message, params object[] args)
{
var formattedMessage = string.Format(message, args);
return Send(formattedMessage);
}
private void UseTls12()
{
// Required for SSL/TLS connection with Telegram
// Will work only on .Net 4.5 or higher
// Using number to avoid compilation error
System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072;
}
}
After adding this class to your cBot or indicator you can send notifications like this:
replace <TOKEN> and <CHAT_ID> with yours
private TelegramBot TelegramBot;
protected override void OnStart()
{
TelegramBot = new TelegramBot("<TOKEN>", <CHAT_ID>);
TelegramBot.Send("Started {0} {1}", SymbolName, TimeFrame);
}
NOTE: cBot and indicators need extended permission. You need to use Internet or FullAccess permissions:
[Robot(AccessRights = AccessRights.Internet)]
public class NewcBot : Robot
@Don't split lines so much when reformatting source during build: 23 Oct 2019, 09:15
You can disable auto formatting in code editor using this setting:
@Chart time frames: 03 Aug 2019, 11:39
Try this indicator
https://ctrader.com/algos/indicators/show/1979
@Introducing Chart Controls in Automate API: 26 Jul 2019, 16:38
I don't know what for, but here you are. Analog clock on the chart
https://ctrader.com/algos/indicators/show/1975
@Partial close is not supported in backtesting?: 01 May 2019, 09:21
Hi,
It works in backtesting with
ModifyPosition(position, newVolume);
@Making a drawed line interactive: 22 Apr 2019, 09:10
Hi,
var line = Chart.DrawHorizontalLine("my line", Symbol.Bid, Color.Red); line.IsInteractive = true;
@OnMouse Over: 07 Mar 2019, 14:16
Btw there is a bug in API. When a new object is added to a chart bot receive hover event and object is null in the event args.
So you need to check a null check in the example above.
@OnMouse Over: 07 Mar 2019, 14:04
lec0456 said:
I would like to have some text appear on the chart when the mouse rolls over a chart object such as a Chart.DrawVerticalLine.
Is there a way to program this behavior?
Basically, I would think that there is some sort of event that couls be triggered to display a box of text.
The indicators do this by default now. When you rollover a chart object it displays a small popup that has the name of the indicator, its settings and its current value.
protected override void OnStart() { Chart.ObjectHoverChanged += OnChartObjectHoverChanged; } void OnChartObjectHoverChanged(ChartObjectHoverChangedEventArgs obj) { if (obj.IsObjectHovered) Chart.DrawStaticText("hoverText", obj.ChartObject.Name, VerticalAlignment.Top, HorizontalAlignment.Left, Chart.ColorSettings.ForegroundColor); else Chart.RemoveObject("hoverText"); }
@Understanding of the Generic Algo: 25 Feb 2019, 10:56
You can try to tweak your fitness function. Genetic optimization stops when there are no improvements after several iterations (fitness function return the same result). Which means you stuck at the local maximum.
Ideally it would be good to have a sim running on top 10 fitness bots infinately till stopped. (Trying to find better settings).
Don't do this, you will quickly find a local maximum without exploring other possibly more profitable areas.
Here is a very good video lecture from MIT about Genetic Algorithms.
https://www.youtube.com/watch?v=kHyNqSnzP8Y
Besides explaining how GA works, it shows simple examples of how you can stuck on a local maximum without exploring the whole area of possible outcomes.
Regards,
Bart
@Small Popup. What does it mean?: 14 Feb 2019, 12:19
ctid863631 said:
Hi Bart,
Thanks for your help. do you also know what the buttons mean? been looking alover for it but no result.
This panel is for working with UI elements while developing WPF or other UI applications: selecting element, change its properties etc.
You can read about it here:
https://devblogs.microsoft.com/visualstudio/introducing-the-ui-debugging-tools-for-xaml/