
Topics
Replies
PanagiotisCharalampous
13 Feb 2019, 15:00
Hi rooky06,
See below an example
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewIndicator : Indicator { [Output("Main")] public IndicatorDataSeries Result { get; set; } private MovingAverage _ma; private FractalChaosBands _fcb; private BollingerBands _bb; protected override void Initialize() { _fcb = Indicators.FractalChaosBands(14); _ma = Indicators.MovingAverage(MarketSeries.Close, 14, MovingAverageType.Simple); _bb = Indicators.BollingerBands(MarketSeries.Close, 14, 2, MovingAverageType.Simple); } public override void Calculate(int index) { //Result[index] = .. } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 12:27
Hi Ogacha,
Thanks I understood now. Unfortunately this is not possible at the moment. You can only specify the level value at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:47
Hi Ogacha,
Yes it is. See an example below
[Output("Test Series", PlotType = PlotType.Histogram, Color = Colors.Green, LineStyle = LineStyle.Solid, Thickness = 2)] public IndicatorDataSeries TestSeries{ get; set; }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:39
Hi terryww2,
Regarding your questions
1. The server does not drop the connection as soon as you pull the cable from the server but when it stops receiving heartbeats for a specific period of time.
2. Yes this is expected
We will investigate the issue with Roboforex.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:35
Hi incdpr,
Thanks for posting in our forum. To access the current value of any series you can use LastValue e.g.
MarketSeries.Close.LastValue
To access previous values you can use Last(x) where x indicates the number of bars you want to move backwards e.g.
MarketSeries.Close.Last(1)
for the previous bar value.
Let me know if this helps.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:26
Hi rooky06,
There are no immediate plans for this. You can suggest it in our UserVoice forum.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:24
( Updated at: 19 Mar 2025, 08:57 )
Hi shrumr,
You can send us an email at support@ctrader.com
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:21
Hi rooky06,
Why do you need to convert these indicators since they already exist in cTrader? The best option to convert an indicator is to contact a Consultant.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:18
Hi uwyness,
The index for Results and series.Close do not necessarily match. To set a valid value to results use the following
Result[index] = series.Close[series.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index])];
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:11
Hi ctid731646,
Spot price subscription will return you only the top of the book price. Depth subscription with return the entire depth of market. For differences in the price feed, please contact your broker since they are in charge of their price feed.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:05
Hi sky pips,
thank you for posting in our forum. Take profit can be set in the following function
//+------------------------------------------------------------------+ //| Order send command | //+------------------------------------------------------------------+ private TradeResult OrderSend(TradeType type, double sl) { long ivol = VolumeSetup(); return (ExecuteMarketOrder(type, Symbol, ivol, Label, sl, 0)); }
Just replace 0 with the Take Profit you want
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 10:02
Hi MZen,
Yes you can use Open API in cBots. Open API doesn't have any classes with client side functionality, it is just proto messages that allow you to communicate with the server.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 09:58
Hi tasr1r1,
Can you send us some troubleshooting information when this happens again? To do so, press Ctrl+Alt+Shit+T, paste in the textbox the link to this discussion and press Submit.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 09:53
Hi Erick,
1. Through Market Series. An example for let's say close price is MarketSeries.Close.Last(10).
2. Use MarketSeries.TickVolume.LastValue
3. An example to get the close price for 24 hours before MarketSeries.Close[MarketSeries.OpenTime.GetIndexByTime(Server.Time.AddDays(-1))];
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 09:34
Hi ruylopez,
How about other cBots? Does it happen when you build other cBots as well on all computers?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 09:32
Hi ctid731646,
A better way to achieve this would be to check the trigger price on your side and send market orders with tag 44 specified. In this case, your order will be triggered as a limit order, since tag 44 will represent the limit, and will use IOC for execution.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Feb 2019, 16:06
Hi ctid731646,
Thanks for the clarification. To investigate further please post a message and the exact time that was sent for which a reply has not been received. Also please let us know the proxy you used to connect.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Feb 2019, 14:39
Hi ruylopez,
When you say the file, do you mean the cBot file or the dll? Does this happen on other computers as well? Does it happen with all cBots or only one? When you reinstalled cTrader, did you try Clean Installation?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
12 Feb 2019, 09:43
Hi ctid731646,
Thanks for posting in our forum. How do you read the messages from the stream? Do you just read once after to send the message or do you have a listener that constantly checks for incoming messages?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Feb 2019, 15:18
Hi ruylopez,
You can build a cBot using Visual Studio however the fact that you say that this happens on ALL computers for ALL cBots doesn't make much sense. Do you say that if you build e.g. Sample RSI cBot on any computer, you get that error on all computers you try? If the problem was so widespread then somebody else would have noticed too. Which broker's cTrader do you use?
Best Regards,
Panagiotis
@PanagiotisCharalampous