Replies

karatedog
02 Sep 2024, 09:00 ( Updated at: 03 Sep 2024, 05:12 )

RE: Self-hosting CALGO VPS?

PanagiotisCharalampous said: 

Hi there,

We do not have any ETA for this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 

Hi,

any update on this?

Thanks!


@karatedog

karatedog
28 Aug 2024, 10:23 ( Updated at: 28 Aug 2024, 11:42 )

RE: RE: RE: RE: How to clear the Bactesting tab after the backtest ran?

This was really helpful: 


@karatedog

karatedog
28 Aug 2024, 10:03 ( Updated at: 28 Aug 2024, 10:06 )

RE: RE: RE: How to clear the Bactesting tab after the backtest ran?

PanagiotisCharalampous said: 

No it doesn't. Check how you can plot indicators using a cBot https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/?h=addindicat#addindicators

Also, this kind of displaying the trades (drawing gazillion horizontal lines) is pretty much useless, compared to what others do to make less noise:

The horizontal likes are not trades. They are positions and orders. You can enable/disable the in your chart's viewing options. Deals are represented with the deal map.

Take some time to learn cTrader better and your life will become easier :)

I think the root cause is that you think I know what you know :D and obviously I don't. I cannot sometimes even formulate a question because I have no idea what the underlying terminology should be.

I have checked the link you sent me, and it made me realize, I can create an indicator within a cBot (immediate question, by creating an Indicator class? same way as I create an Indicator, creating a subclass of Indicator class? I could not find further info on this). However this information is an “island”, I have been reading through help pages and Google for quite a time on cTrader, and no information ever lead me to this direction.

Also, poses the question, if I add something that is Indicator-like, why it is not automatically added without me telling “I want to add”? I have first created an Indicator, then I copied the code to cBot, and my Outputs were never drawn. So I concluded (just the same way Metatrader works) I cannot add line plotting to a cBot. (I now understand the technically an Indicator and a Robot has to be coded into a different class but this technicality could have been hidden from the developer).

And if I can add every Indicator element to a cBot, and it only takes a flip of a switch to show them, why separate Indicators and cBots? This separation is strangely in even Tradingview as well (study vs. strategy), where you don't need to modify any code between the two types just add the order management and suddenly an indicator turns into robot, but ie. their plotchar() works in both study and strategy, I don't need to refactor, move or any way modify code. They might be different behind the scenes, but it is hidden from me because it does not add any value knowing that difference.

Thanks for all the info, it was very useful!


@karatedog

karatedog
28 Aug 2024, 09:41 ( Updated at: 28 Aug 2024, 10:06 )

RE: RE: RE: How to clear the Bactesting tab after the backtest ran?

PanagiotisCharalampous said: 

karatedog said: 

BlackTiger83 said: 

Why would you want that? Simply start a new test with new parameters :)

 

Take some time to learn cTrader better and your life will become easier :)

Thanks a lot for the above information. I would learn cTrader better but unfortunately these forum posts are the best information source besides Google. I was not successful searching the Help. though it is true, I did not want a full-fledged debugging feature, having simple markers on the chart is enough.


@karatedog

karatedog
28 Aug 2024, 09:37 ( Updated at: 28 Aug 2024, 10:06 )

RE: RE:

ncel01 said: 

PanagiotisCharalampous said:

Hi ncel01,

As far as know, you can ask your broker for the leverage you want for your account. Also cTrader offers the option to traders to change their leverage but in needs to be enabled by the broker.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 

Hi Panagiotis,

 

I've checked this across a lot of brokers and the account leverage is fixed and equal to the maximum allowed by the applicable jurisdiction.

Depends on the broker.

I was using OANDA (HQ-ed in Malta), and I could chose between 1:1, 1:5, 1:20:, 1:30, 1:50, 1:100 leverage. Then European rules came by and OANDA sold the Malta branch to TMS (Polish broker), becoming OANDA TMS.

Now OANDA TMS offers fixed leverage based on product type. Forex majors are usually 1:33, indices 1:20 and stocks 1:5, there is no way to change it.

This all depends on the broker, and most broker systems are stone-age with their user facing parts (their backoffice execution might be state-of-the-art, I have no idea). 

The best example of “good” broker system will always be the crypto brokers, like Binance where you can decide on EACH trade how much leverage you want to use up to the maximum.

Also almost none of these brokers offer 1:1 leverage which would be extremely useful for beginners, especially with shorting as on a 1:1 margin (which is None), there should not be any margin call or liquidation. 

 


@karatedog

karatedog
27 Aug 2024, 07:46 ( Updated at: 27 Aug 2024, 09:24 )

RE: Optimize tab's "20 best passes"

YesOrNot2 said: 

1. The best pass corresponds to the genetic search that gives the best results based on the desired optimization criteria.

I can still not figure out how “best” is calculated, I think I will first start with the brute-force one, until I get a better grasp of this.

2. Click on the column names; you can find the best pass, Sharpe ratio, etc.

I have re-checked the columns, and ordering by “Fitness” ordered all the 20 best results to the top. I'll run another optimize and will check while it is running as I remember I have checked the Fitness column but it gave me no result (and I might be wrong).

3. To get rid of certain criteria, you need to use the get fitness function. You can find an example in this code: https://ctrader.com/algos/cbots/show/3768/

Thanks!

 


@karatedog

karatedog
26 Aug 2024, 14:55

RE: RE: Drawing a character per candle in a cBot backtest resulted multiple characters drawn on a higher timeframe candle

karatedog said: 

PanagiotisCharalampous said: 

Hi there,

Thank you for reporting this issue. We managed to reproduce it and it will be fixed in an upcoming update.

Best regards,

Panagiotis

Thank you. Any workaround until it is fixed?

I found a workaround:

  • duplicate the cBot
  • delete original cBot
  • attach symbol to the new cBot

So it looks like the issue is tied to the cBot file/cache.


@karatedog

karatedog
26 Aug 2024, 14:45

RE: Drawing a character per candle in a cBot backtest resulted multiple characters drawn on a higher timeframe candle

PanagiotisCharalampous said: 

Hi there,

Thank you for reporting this issue. We managed to reproduce it and it will be fixed in an upcoming update.

Best regards,

Panagiotis

Thank you. Any workaround until it is fixed?


@karatedog

karatedog
26 Aug 2024, 14:37

RE: RE: RE: What kind of text?

PanagiotisCharalampous said: 

Hi there,

Please let us know which examples are obsolete so that we can update them.

Best regards,

Panagiotis

Hey Panagiotis,

I found a lot of examples that referred to MarketSeries to which I got a warning at build time that it is obsolete.

Thank you
karatedog


@karatedog

karatedog
26 Aug 2024, 12:36 ( Updated at: 26 Aug 2024, 12:49 )

RE: How to clear the Bactesting tab after the backtest ran?

BlackTiger83 said: 

Why would you want that? Simply start a new test with new parameters :)

And hope for the script to be better? :D

Clearly, I have no idea why my script is wrong (otherwise I would not have programmed that problem into the script). So I have to “debug”. There is no debug feature in cTrader so I had to make it myself which is bastardizing the output screen with drawn characters where certain events should have happened (like to MAs crossing each other and THERE I expect the BUY to happen). I have to do this because cBots lack almost all plotting features that an Indicator has (for some weird reason). 

But those self-created debug prints will be completely overwhelmed by the result of the backtest and there was no obvious “clear” option.

When you add a symbol to a cBot, the starting screen is empty. Why isn't there an action that brings the user back to that empty state?

Also, this kind of displaying the trades (drawing gazillion horizontal lines) is pretty much useless, compared to what others do to make less noise:


@karatedog

karatedog
23 Aug 2024, 11:14

I was able to achieve a mixed state where certain candles have multiple characters, but others do not:


@karatedog

karatedog
23 Aug 2024, 10:13

RE: too many messages and the cbot gets stuck

PanagiotisCharalampous said: 

Hi there,

No it is not. You need to minimize the messages you print in the log.

Best regards,

Panagiotis

Is there any way to configure what is “too many”? I don't mind if the application eats more memory or slows down. I need to know what is happening inside the code as I'm in a learning phase and many times there is a clear clash between how I understood the Help (which sometimes does not answer my question) and how really cTrader works. Eventually I will remove almost all of them when I get a better understanding but until then when find a non-syntax issue (when it compiles but does not do what I want), I put a lot of Print around it, draw a lot objects to the chart to understand what I did wrong.


@karatedog

karatedog
22 Aug 2024, 22:15

RE: RE: RE: What's the sanest way to access a completed bar?

PanagiotisCharalampous said: 

Hi there,

The argument was about changing OnBar() method, not adding something new. Since then we have added OnBarClosed() method for this purpose.

Best regards,

Panagiotis

Exactly. The argument was about changing the Onbar() method. You argued that it cannot be changed as a lot of code relies on that. So I showed an example how others do it, like versioning the programming API or - as Python did - doing something extreme, if that makes the overall experience better.

Now you have added OnBarClosed() which kinda solves the problem, but this means you wanted to maintain “v1.0” compatibility so instead of modifying OnBar() (and put it into a new namespace/API version or throw it away if it is not used at all in this current form), you created another API endpoint. This is a design decision which yours to make but there is a good reason programming languages chose not to do this as you will very likely end up with a lot of bastardized OnBarClosedWhenCertainConditionsAreMet() kind of methods in 10 years and newbies like me will just encounter a very steep learning curve.

I'm a newbie with the cTrader language API (coming from Pinescript) as I expected a lot more flexibility with the language (that I got), but I also stumbled into a high level of complexity which looks like a baggage from the past being afraid to throw away what is not working well. 

So I'm new here, I didn't want to kick in the door and tell around what to do, I've just got experience with domain specific languages which try to follow the “principle of least surprise” (POLS) paradigm, and part of that is not to be afraid to change something drastically if it gets better. People will learn the new rules and follow up.

Just an example, I work a lot with the current closed bar's open and close price. In Pinescript I wrote “open” and “close” to access those values. Here I do Bars.OpenPrices.LastValue and Bars.ClosePrices.LastValue. (if there are easier solutions, I was not able to find it in the Help). I'm not advocating Pine here, but for the former keywords I would not have to know anything about the classes and methods (which I cannot even search for, as I have no idea what to even look for) even a wild guess would have worked. For the latter, I have to know the proper classes and read a good amount to even start.

Best regards,
Laz


@karatedog

karatedog
12 Aug 2024, 14:31

RE: What's the sanest way to access a completed bar?

PanagiotisCharalampous said: 

…we cannot change something that works and thousands of cBots are built on it…

Though this post is a bit old, I disagree with the statement as I see the opposite being true all the time.

You are not really changing something that has thousands of working code relying on it, you create a new one and cleverly separate the two so people have time to adapt to the new version (and you give help and hints on the way to assist them). Otherwise you are locking yourself to a fixed path and I'm sure what was good and mainstream 10 years ago is outdated today. You cannot maintain v1.0 compatibility forever.

Most of the programming languages do this between major versions but Python is a good example with its change between v2.x and v3.x. As a trading language example Tradingview uses code version annotation in their Pine script to allow them completely revamp the code if they want to.


@karatedog

karatedog
05 Aug 2024, 15:19 ( Updated at: 06 Aug 2024, 05:38 )

RE: What kind of text?

firemyst said: 

You don't say what kind of text you're wanting to align.

That might be because newbies like me don't have a clue what kind of Text are out there, and coming from other programming languages the immediate practice is, it should not matter, it is Text at the end.

The documentation is lacking, badly organized and probably not maintained, I get constant warnings for obsolete methods when copying examples from the documentation.

This forum post was the single answer to my question as well, otherwise I would not even imagine that half of the properties for Text object is defined with the DrawText method and other half is defined on the base class properties. This is not just ugly, it makes the learning curve extremely steep. 

Thanks for the info!

 


@karatedog