Topics
Replies
Spotware
05 Sep 2017, 09:07
Dear Trader,
Thanks for reporting this issue to us. We tried reproducing the described behavior following your description but we couldn't. Market series for several symbols that are closed for trading seems to be working fine. Can you please provide us with the cBot and a specific symbol that reproduces the error. Please also inform us which broker do you use so that we can use the exact same environment to reproduce the problem.
Best Regards,
cTrader Team
@Spotware
Spotware
04 Sep 2017, 12:36
Dear Trader,
You can find examples on how to use the functions in the links above. HasCrossedAbove and HasCrossedBelow functions can be used for all indicators. See also below a small example checking if the simple moving average indicator has crossed above the exponential moving average indicator
var sma = Indicators.SimpleMovingAverage(MarketSeries.Close, 5); var ema = Indicators.ExponentialMovingAverage(MarketSeries.Close, 5); var crossedAbove = sma.Result.HasCrossedAbove(ema.Result, 5);
Let us know if you need any further explanation.
Best Regards,
cTrader Team
@Spotware
Spotware
04 Sep 2017, 09:20
Dear Trader,
Thanks for posting in our forum. You might find the following functions useful.
HasCrossedAbove and HasCrossedBelow can be used for checking if two dataseries have crossed each other in the respective direction. ChartObjects class contains functions to draw different objects on your charts. SendEmail function can be used to send emails and notifications when some events occur.
Let us know if the above information is helpful for you.
Best Regards,
cTrader Team
@Spotware
Spotware
04 Sep 2017, 09:01
Dear hungtonydang,
Can we have a complete cBot that reproduces this issue to check and advise accordingly? We cannot see anything suspicious in the code provided but information is missing, e.g. we cannot see how the StopLoss value is set.
Also note that ModifyPositionAsync() is an asynchronous function and there is no guarantee that it will be executed before Print(). Try ModifyPosition() instead and let us know if the problem still applies.
Best Regards,
cTrader Team
@Spotware
Spotware
01 Sep 2017, 14:28
Dear Trader,
See an example below that might help. The logic of the example is to check enter criteria inside OnBar() event so that you enter the marker only once in each bar and to check exit criteria inside OnTick() so that you can exit the marker when your exit criteria are met. You can adjust the code accordingly.
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } private bool _criteriaToEnter; private bool _criteriaToExit; protected override void OnStart() { // Put your initialization logic here } protected override void OnBar() { if (_criteriaToEnter) { ExecuteMarketOrder(TradeType.Buy, Symbol, 1000); } } protected override void OnTick() { if (_criteriaToExit) { ClosePosition(Positions[0]); } } protected override void OnStop() { // Put your deinitialization logic here } } }
Let us know if this is what you are looking for.
Best Regards,
cTrader Team
@Spotware
Spotware
01 Sep 2017, 09:52
Dear Trader,
Thanks for informing us about this issue. You should be getting your password on creating a new account in Spotware cTrader demo. We are currently investigating why the email was not sent. In the meanwhile, you can open a demo account with one of our brokers and use it for your FIX API experimentation.
Best Regards,
cTrader Team
@Spotware
Spotware
01 Sep 2017, 09:35
Dear Trader,
Thanks for posting in our forum. Your issue is related with your cBot's access rights which are declared in the cBot's attributes. You can find the guide for the access rights here.
More specifically, you need to change your cBot's access rights from AccessRights.None to AccessRights.FileSystem like the example below
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
Best Regards,
cTrader Team
@Spotware
Spotware
31 Aug 2017, 12:06
Hi PanPat,
We investigated the issue and it seems there is a demo account following your strategy. Therefore the mirroring funds are 0 but you cannot stop providing signals. To be able to stop providing signals you need to either close your positions or the account that follows you to stop following you.
Best Regards,
cTrader Team
@Spotware
Spotware
31 Aug 2017, 09:13
( Updated at: 21 Dec 2023, 09:20 )
Dear PanPat,
If you want to stop mirroring other providers, you have to click the Stop button besides the strategy you are following which is listed under your account. See image below
If you want to stop providing signals to other users, click the "Stop Providing Signals" button on the top right corner of the account's page. See image below
Let us know if this information is helpful to you.
Best Regards,
cTrader Team
@Spotware
Spotware
30 Aug 2017, 15:11
Dear Trader,
This happens because the ping request is disabled in the example project. In order to enable the ping request, please go to TradingApiTest.cs, line 70 and uncomment the SendPingRequest function.
Let us know if this works for you.
Best Regards,
cTrader Team
@Spotware
Spotware
30 Aug 2017, 14:44
Dear Trader,
Web requests are required for Accounts API. Trading API uses sockets. It is not a prerequisite to have a web application. Nevertheless, you can send the requests from a WinForms application as well. You can take the Connect API library found in our ASP.Net sample application and use in a WinForms project as well.
Let us know if you need any further assistance on this.
Best Regards,
cTrader Team
@Spotware
Spotware
05 Sep 2017, 09:20 ( Updated at: 21 Dec 2023, 09:20 )
Dear Trader,
Thanks for posting in our forum. You equity at any time equals to the balance plus the unrealized net profit and loss. See screenshot below.
Here the equity is calculated with the following equation, €2500 + (-€4.72) = €2495.28.
In your case, what seems to be happening is that you are closing only profitable positions, causing the profit to be realized and your balance to be increased while the losing positions are keeping your equity low.
Best Regards,
cTrader Team
@Spotware