Topics
Replies
Spotware
21 Aug 2017, 10:43
Dear ngoccuong9xhb,
Thanks for posting your suggestion in our forum. It is in our immediate plans to improve the cAlgo.API documentation with more information and more meaningful examples. However documentation is a never ending process and the provided examples will never be able to cover all possible usages of the API. Therefore, we aim to fill any gaps through this community. If there is any specific question you have or if you need an example of usage for any of the API classes, please let us know to provide it to you.
Best Regards,
cTrader Team
@Spotware
Spotware
21 Aug 2017, 10:28
Dear slodder04,
Thanks for posting your question in the forum. Open, Close, High and Low prices can be obtained as DataSeries in a cBot as follows.
protected override void OnBar() { var open = MarketSeries.Open; var close = MarketSeries.Close; var high = MarketSeries.High; var low = MarketSeries.Low; }
Let us know if this is what you need.
Best Regards,
cTrader Team
@Spotware
Spotware
18 Aug 2017, 15:11
Dear obaum1@gmail.com,
Stop Limit order is not yet available in cAlgo. It will be included in a future release. To achieve a similar functionality you will need to monitor the price movement yourself and when the price crosses the desired stop price, you should execute a market order with the desired market range.
Let us know if the above suggestion helps.
Best Regards,
cTrader Team
@Spotware
Spotware
18 Aug 2017, 15:05
Dear ycomp,
Thanks for your question but it is not very clear what you ask. What you have posted is the entry price. Do you mean the entry time? If you want to convert the position's entry time to your timezone, you can use something similar to the following code
ExecuteMarketOrder(TradeType.Sell, Symbol, 1000); var timeDifference = DateTime.Now - DateTime.UtcNow; Print(Positions[0].EntryTime + timeDifference);
Best Regards,
cTrader Team
@Spotware
Spotware
18 Aug 2017, 14:27
Dear dleeeq8,
Thanks for posting your suggestions and issues with Autochartist on the forum. Please note that this is a third party service provided by Autochartist. We will communicate your suggestions and questions to them (points 2 and 4) but maybe you would like to contact them as well.
Regarding the issue with the images, we cannot reproduce it. Can you please tell us the broker and the platform you are using so we can check?
The service is not accessible from cAlgo but it is available on the service provider's website.
Best Regards,
cTrader Team
@Spotware
Spotware
18 Aug 2017, 11:04
Dear Alex,
Essentially a SL and a TP are just a stop order and a limit order associated to a position with the same volume but in the opposite direction. SL and TP are more of an interface feature that allows you to keep pending orders associated with a position, rather than a specific trading instruction. Therefore we do not plan to make this feature a part of FIX API. Instead, it is advised to implement SL and TP on your side by opening a stop loss order and a limit order linked to a position with the same volume and the opposite direction.
Best Regards,
cTrader Team
@Spotware
Spotware
18 Aug 2017, 10:09
( Updated at: 21 Dec 2023, 09:20 )
Dear sand,
Thanks for your post. Please see below some useful information regarding the issues raised
1) So I think that the only logical reference ID for a "history statement" must be the PosMaintRptID.
The history statement in cTrader displays the deals and not the positions, hence the DID (Deal ID). An order might be filled by one or many deals e.g in the case of partial filling, and these deals will result into a position. In the history tab, If you click on the “i” button in each deal you will see the requesting order as well as the resulting position. See image below.
2) A similar problem is in the "Positions" panel of the cTrader.
If you right click on the Positions Grid header, you can see all the available columns. You can click on the ID column for the PID to display in the Positions Grid
Let us know if the above information is helpful to you.
Best Regards,
cTrader Team
@Spotware
Spotware
17 Aug 2017, 16:23
Dear Omega,
Thanks for posting this suggestion. We will investigate with the product team the feasibility of adding advanced protection features in Create Order form. In the meanwhile, could you please let us know which trading platforms offer this as a standard feature?
Best Regards,
cTrader Team
@Spotware
Spotware
17 Aug 2017, 09:23
Dear hungtonydang,
If you need to set the expiration time one hour after placing the order, you can try something like the following
var datetime = DateTime.Now.AddHours(1); PlaceLimitOrder(TradeType, Symbol, Volume, targetPrice, MyLabel, StopLossPips, TakeProfitPips, datetime);
Best Regards,
cTrader Team
@Spotware
Spotware
16 Aug 2017, 17:05
Dear Trader,
Thanks for posting your question in the forum. There is no out-of-the-box functionality to backtest strategies using Connect API, since this is beyond the scope of this API. If you need such functionality you will need to develop it yourself. If your plan is to develop automated robots, we encourage you to reconsider cAlgo and C#. If you have a good background in Java, then It will take you much less time to become proficient in C# than to rebuild the features of cAlgo from scratch. Regarding Linux, we believe that it will not add any real value to your solution.
Best Regards,
cTrader Team
@Spotware
Spotware
16 Aug 2017, 14:25
Hi andi21,
This is known behavior. Only current market series is modified until indicator is initialized and it has values for history bars. It is done to simplify workflow for developers and it was designed before multi timeframes indicators were introduced. For now we are not planning to change it as changing this behavior will break existing indicators. But we are keeping this in mind for our future development.
There is an option to find index at other TimeSeries, you can use x.OpenTime.GetIndexByTime()
Best Regards,
cTrader Team
@Spotware
Spotware
21 Aug 2017, 16:08
Dear obaum1@gmail.com,
In principle it should be faster since Trading API is optimized with communication speed in mind. If you decide to proceed with this, It would be interesting to share some comparisons with the rest of the community.
Best Regards,
cTrader Team
@Spotware