Topics
Replies
fermjy
08 Apr 2018, 00:46
RE:
Panagiotis Charalampous said:
Hi Dutch_Porto,
Renko and Range bars will be available in cTrader Web but not for version 3.01. They will be added in a future update.
Best Regards,
Panagiotis
Hi Panagiotis Charalampous, Spotware thought about letting the user create his own display? I mean, for example, UniRenko.
It will be much faster if you let us change the time of the bars and... well, that would be it. The recent update of several tick charts(which is awesome) proves that you can. It would be nice that users can do the same.
Enjoy your weekend.
@fermjy
fermjy
24 Apr 2017, 16:40
Apparently the backtesting keeps adding entries without an exit point... I just know this because I used Print to see which Positions had a net loss... And It Prints opened Positions 2 hours after the Backtesting stops.
So the backtesting keeps going, but It doesn't show it in the charts and data... so... I have no idea whats going on.. and why this happens...
@fermjy
fermjy
23 Mar 2017, 19:47
Solved
Ok.. after........ a while... ripping out my code... I found the problem
I still can't believe it...
I start all my bots with..
namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NameOfTheBot: MyRobot {
MyRobot.cs
namespace cAlgo.Library { public class MyRobot : Robot { private string label = "MyRobot"; private Grid grid; private MarketAction marketAction; private MarketStatus marketStatus; public string Label { get { return label; } set { label = value; } } public Grid Grid { get { return grid; } } public MarketAction MarketAction { get { return marketAction; } } public MarketStatus MarketStatus { get { return marketStatus; } } public MyRobot() { // Put your initialization logic here cBot.setInstance(this); // so far.. so good }
cBot.cs
namespace cAlgo.Library { public static class cBot { private static MyRobot robot = null; public static MyRobot Robot { get { return robot; } } .... public static void setInstance(MyRobot robot) { //if (cBot.robot == null) <---- * cBot.robot = robot; } }
* Well.. i putted that condition, just in case in the future the DLL gets bigger... so.. I just tested without that condition.... all is working fine now....................
I have no idea why that condition gives issues when I execute the code after the first time... If some one is so kind to explain it, I would appreciate it. Because It might happen again.
:S
Thanks for your time and patience.
@fermjy
fermjy
23 Feb 2017, 05:43
The previous name of the cBot was "A Robot", now I changed to "ARobot" and this came out...
Error : Error occured during parsing project file: 'Unrecognized Guid format.'
"A Bot".. class ABot.. error..
Error : Error occured during parsing project file: ''BotultT' is an unexpected token. The expected token is '='. Line 2, position 34.'
Ahm.. well... I changed to "something"...
Error : Error occured during parsing project file: 'Unrecognized Guid format.'
I will recreate the bot, but I'm just reporting the bug..
@fermjy
fermjy
10 Feb 2017, 23:35
RE:
mindbreaker said:
And here your first example with cAlgo Api dll (you need include calgo api dll to your ddl as reference)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // cAlgo.Api References using cAlgo.API.Collections; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.API.Requests; namespace Boo { public static class Class1 { public static double Price(Symbol my) { return my.Ask - my.Bid; } public static double PipSize(Symbol my) { return my.PipSize; } } }And in cbot:
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; using Boo; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class DLL : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } protected override void OnStart() { // Add Symbol Print(Boo.Class1.Price(Symbol)); } } }And works fine. :)
Thanks mindbreaker, that's what I'm doing for now, but the code is passing something by reference. If It isn't Robot, is Symbol :(
I will figure it out eventually.
Thanks for your time and patience.
@fermjy
fermjy
10 Feb 2017, 22:22
RE:
mindbreaker said:
Hi,
look at this /api/guides/trading_api
use functions
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } protected override void OnTick() { SayHello("JIMBO"); if(SayHello("JIN") == "Baraki"){ Print("Booooooo"); } } /// !!!!!!!!!!!!!!!!!!!!!!!!!!!! YOUR CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! public string SayHello(string Name = "AlojzyBombel") { // Print to log Print("HELLO " + Name); // return value, string ... return "Baraki"; } } }
Or try decompile DLL for example with https://www.jetbrains.com/decompiler/
and see how they do it ;)
It C# search in google how to create dll library in visual studio on youtube and ....
Bye.
I already have my code... thats what I'm saying... and I have almost 1k of lines... I don't want to put them in every cBot that I make... I prefer to do It loading a DLL... but I have that problem with reference for example... (I know hot to make a dll.. thank you for the google search)
If there is no way to change the cAlgo.API.dll... I will have to use my own DLL... but sooner or later... DLL or not... I have to pass the reference.. at least for what I know...
So If someone knows how to avoid this.. please help
@fermjy
fermjy
24 May 2019, 04:54
Hi cTraders.
I was wondering if you were able to provide the entire Fitness function by default that you normaly use at the Optimization.
Thanks for your time.
@fermjy