Topics
Replies
PanagiotisCharalampous
23 Aug 2024, 06:53
Hi there,
Which main page are you referring to? Can you share some screenshots so that we can understand what you are referring to?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:51
RE: Backtesting Settings -> Data Dropdown Bug
scotpip said:
I'm not clear where we're supposed to report bugs. If this is the wrong spot, please advise.
In this release, I'm seeing a repeated option in the Backtesting Settings → Data dropdown dialogue.
Hi there,
The one option is always m1 and the other one adjusts based on the selected timeframe. If you select m1, then these two options coincide. I don't think this is a big issue to be honest.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:49
Hi there,
Is your backtester equivalent to cTrader i.e. handles all necessary calculations, like margin calculation, conversions between currencies etc. If it is not, then the comparison is not really valid.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:46
RE: RE: How to Access OHLC Prices in the Backtester?
scotpip said:
Hi Panagiotis
Many thanks! That seems to be working now, both with m1 data and tick data.
I assume that all 4 prices are used when evaluating exit stops, and calculating indicators like the ATR which need OHLC values?
If you're open to feedback, I feel that the bar event methods and docs are confusing. This is something you might care to review.
In the tutorial, OnBarClosed() isn't even mentioned:
https://help.ctrader.com/ctrader-algo/articles/for-developers/create-a-cbot-in-5-mins/#add-a-new-cbotThe wording doesn't make it explicit that you will be accessing an incomplete new bar, rather than the newly completed old bar with all the OHLC data. In every other platform I've used (quite a few now) OnBar() passes or signals the interesting old bar rather than the uninteresting new bar.
The next point of confusion is the dropdown from the cog menu item, which clearly states that you are only getting open prices. While in fact as you have just explained you can access all 4 prices. (And there's also the bug where it shows the same option twice). Surely this is a UX glitch?So unless the user takes a deep dig through the API docs, the procedure for accessing this vital data is both unintuitive (in the sense that other platforms do it differently) and well hidden (in the sense that the tutorial doesn't explain it and the cog dropdown text is misleading).
Maybe I'm unusually dim, but I'm surprised that more people haven't run into this roadblock. It would be helpful if the tutorial and the dropdown were more user-friendly…
Geoff
Hi Geoff,
Thanks for your suggestions. Here are my responses to some of the points raised
The next point of confusion is the dropdown from the cog menu item, which clearly states that you are only getting open prices.
You get all historical OHLC prices but the execution is based on the open prices only
And there's also the bug where it shows the same option twice
It's not really a bug. In general, these are two different options, the one is to use the selected timeframe's bars, the other is to use m1 bars (even if you are on h1). When you choose m1 these timeframes coincide. It looks weird in this specific case but I not think it's a real problem.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:39
Hi there,
I can see 11180. Can you check again?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:36
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
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:34
Hi there,
Check the video below
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 14:40
RE: RE: RE: RE: RE: RE: cTrader - Plugins
nature.equity said:
PanagiotisCharalampous said:
cyril269 said:
PanagiotisCharalampous said:
cyril269 said:
PanagiotisCharalampous said:
Hi there,
Plugins will be available in the upcoming major update.
Best regards,
Panagiotis
Is there a potential timeline on when the major update will be released?
Hopefully sometime in the following weeks :)
Is it possible to get a prerelease version of the ctrader.automate nuget that has plugin support?
Unfortunately we do not offer a prerelease version
Hi, following up on this thread from Feb 2024, have you released this updated version (which includes Plugins feature)?
I run my broker's latest cTrader version, and it doesn't include such features yet.
Thanks!
Try downloading v5.0 from below
https://ctrader.com/download/
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 14:39
RE: RE: How to make cBot setting Take Profit when pushing button in Indicator
TommyFFX said:
PanagiotisCharalampous said:
Hi there,
Why don't you just set the take profit from the indicator?
Best regards,
Panagiotis
Because Indicators can not open, close or modify positions/orders ..
And I need some stuff to communicate in the indicator with a cBot then.
I need a way to modify positions (TP) and close positions witch is not possible with Indicator.
I would like to have an Indicator on each symbol I Trade and use it's logic and only have 1 cBot open in the Automate section.
So each indicator can communicate for the actions it can't do like modifying or closing positions when neccessary.
TommyFFX
Since version 5.0 they can, so make your life easier and just trade through the indicator :)
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 14:38
Hi there,
It's hard to answer such vague questions if we cannot see what you are actually doing. Logical errors do not generate any log messages as they are not considered problems by the system. The computer executes what you have instructed it to do, even if this is different from what you expect it to do or what you think it does.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 09:14
Hi there,
Try this tool, you might find it helpful
https://ctrader.com/algos/indicators/show/2969/
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 07:54
Hi there,
Thanks for reporting this issue. It will be fixed in an upcoming update of cTrader.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:35
Hi there,
There is no Last Traded Price on cTrader since it is impossible to have this information in OTC markets.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:31
Hi ncel01,
You guessed right, this is not possible. We are not considering this either, since in the majority of cases, this need can be covered by cTrader Algo.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:26
RE: RE: RE: RE: RE: RE: RE: Account.Margin not correct : Unacceptable
ncel01 said:
PanagiotisCharalampous said:
ncel01 said:
PanagiotisCharalampous said:
ncel01 said:
PanagiotisCharalampous said:
ncel01 said:
?
This issue has been fixed, it's been a while. I cannot reproduce it. Make sure you download historical data when you backtest.
Hi Panagiotis,
The values I get for the account margin are still not matching while backtesting the code above.
Are you backtesting an index? Probably not.I selected the historical data, as suggested.
However, the account and symbol currency is the same (USD) and still I am getting different results when selecting/unselecting this option. Why?
I checked this with both Varianse and Pepperstone (using historial data).
Below is the backtest output with Varianse.Hi ncel01,
Yes I do
However, the account and symbol currency is the same (USD) and still I am getting different results when selecting/unselecting this option. Why?
The functionality should work correctly when the option is checked. We are checking why it is not working when unselected and the quote currency matches the account currency. In the meanwhile, keep it checked.
Panagiotis,
The functionality should work correctly when the option is checked.
How come, when my screenshot clearly shows that Account.Margin is returning 0 even with an open position?
Did you check this with some other accounts/brokers (apart from Spotware)? If not, can you please double-check this?
Thanks.Hi ncel01,
It works fine on Variance as well.
Please send a full screenshot like the above, so that we can understand what you are doing
Hi Panagiotis,
Thanks for looking into this again. I meant an account with a different broker, not exactly the broker version of cTrader.
So far, I found that Account.Margin is not correct in the following cases (at least):
- Example 1: Any live account (tested with Pepperstone and TopFX)
- Example 2: New demo accounts (without trading activity) where Symbol Leverage > Account Leverage (tested with Varianse)
I've added a screenshot for each of these examples (see below). I am running the cBot shared above (historical data is checked).
Note that, regardless of what leverage is considered (symbol/account), the calculated account margin does not match Account.Margin in any of the cases shown.Something is clearly not going as expected here.
The results show that there is not a unique/consistent calculation for Account.Margin, no matter the situation.Example 1:
Example 2:
Something else I noticed in the meantime that I also don't understand: Positions.Count is returning 0 while called inside Positions_Opened().
See below.
Hi ncel01,
As far as I can see, in all the cases with discrepancy, your account currency is different to the symbol currency, however your calculations do not include any conversion logic. The API's property converts the margin to the account's currency value. The XTE issue seems a separate issue, can you report it in a different thread?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:15
Hi there,
Why don't you just set the take profit from the indicator?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:08
RE: RE: RE: RE: Bars can only fetch latest 200 bars
raypang said:
PanagiotisCharalampous said:
raypang said:
PanagiotisCharalampous said:
Hi there,
You can use Bars.LoadMoreHistory() method to load more bars.
Best regards,
Panagiotis
protected override void OnStart()
{
Print(Bars.Count); //200
Bars.LoadMoreHistory();
Print(Bars.Count); //200
}
it seems not work
Can you tell us the broker and the symbol?
EURUSD backtest timeframe 1min ICMarkets
This method does not work on backtesting at the moment. If you need more bars for backtesting, you can start your bactesting at a previous date.
@PanagiotisCharalampous
PanagiotisCharalampous
22 Aug 2024, 05:05
Hi there,
If you are calling LastBar in OnBar() then you will get the same prices, since the method is called on bar opening. Try OnBarClosed() instead and you should get the OHLC values.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Aug 2024, 14:53
Hi there,
Make sure you are using the .Net 6.0 compiler
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
23 Aug 2024, 06:55
RE: RE: RE: RE: How to make cBot setting Take Profit when pushing button in Indicator
TommyFFX said:
There are several ways to achieve communication between a cBot and an Indicator e.g. you can use files or named pipes.
Best regards,
Panagiotis
@PanagiotisCharalampous