Topics
Replies
PanagiotisCharalampous
17 Aug 2018, 10:05
Ηi ryanoia@gmail.com,
Yes you understood it correct. If your logical sequency is not dependent on the outcome of the market order execution, then you should probably use ExecuteMarketOrderAsync.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Aug 2018, 09:47
Ηι alex_mihail,
You can backtest this and check if positions are openen or closed during those hours in history.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Aug 2018, 09:40
Hi ctid386599,
Data for indicators is loaded for periods before the backtesting starts therefore you should not worry about this. You should havemany bricks created on starting your cBot. See example below.
using cAlgo.API; using cAlgo.Indicators; using cAlgo.API.Indicators; using System.Linq; using System; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { private Renko _renko; protected override void OnStart() { _renko = Indicators.GetIndicator<Renko>(10, 100, 3, "SeaGreen", "Tomato"); Print(_renko.Close.Count); } protected override void OnBar() { } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Aug 2018, 09:27
Hi ryanoia@gmail.com,
See below
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class OpenPositions : Robot { [Parameter("Volume", DefaultValue = 1000, MinValue = 1, Step = 1)] public int Volume { get; set; } protected override void OnStart() { var gbpusd = MarketData.GetSymbol("GBPUSD"); ExecuteMarketOrder(TradeType.Buy, gbpusd, Volume, "order 1", null, 11, null); ExecuteMarketOrder(TradeType.Sell, gbpusd, Volume, "order 1", null, 11, null); PlaceStopOrder(TradeType.Buy, gbpusd, Volume, gbpusd.Ask + 16 * Symbol.PipSize, "myStopOrder", null, 11, null); PlaceStopOrder(TradeType.Sell, gbpusd, Volume, gbpusd.Bid - 16 * Symbol.PipSize, "myStopOrder", null, 11, null); var gbpjpy = MarketData.GetSymbol("GBPJPY"); ExecuteMarketOrder(TradeType.Buy, gbpjpy, Volume, "order 1", null, 11, null); ExecuteMarketOrder(TradeType.Sell, gbpjpy, Volume, "order 1", null, 11, null); PlaceStopOrder(TradeType.Buy, gbpjpy, Volume, gbpjpy.Ask + 16 * Symbol.PipSize, "myStopOrder", null, 11, null); PlaceStopOrder(TradeType.Sell, gbpjpy, Volume, gbpjpy.Bid - 16 * Symbol.PipSize, "myStopOrder", null, 11, null); var gbpcad = MarketData.GetSymbol("GBPCAD"); ExecuteMarketOrder(TradeType.Buy, gbpcad, Volume, "order 1", null, 11, null); ExecuteMarketOrder(TradeType.Sell, gbpcad, Volume, "order 1", null, 11, null); PlaceStopOrder(TradeType.Buy, gbpcad, Volume, gbpcad.Ask + 16 * Symbol.PipSize, "myStopOrder", null, 11, null); PlaceStopOrder(TradeType.Sell, gbpcad, Volume, gbpcad.Bid - 16 * Symbol.PipSize, "myStopOrder", null, 11, null); } protected override void OnTick() { // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 17:12
Hi ceakuk,
This issue has been fixed in Spotware cTrader Public Beta. A fix will be applied to brokers soon.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 16:50
Hi ctid386599,
It is not clear to us what do you need.
- What is custom renko? A cBot or an indicator? Can you post the code?
- Why do you need data from earlier periods and how are these data related to the cBot/Indicator?
If you give us some more information on what you are trying to do then we might be able to help you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 14:49
Hi jsohail60,
Can you please try to clean your browser cache and let us know if this resolves the problem?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 12:01
Hi usdissanayake@gmail.com,
Thanks for posting in our forum. You can change your if statement to the following
if( _ema5.Result.HasCrossedAbove(_Wma.Result, 1)) { }
This will check if EMA has crossed WMA during the previous bar.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 11:58
( Updated at: 21 Dec 2023, 09:20 )
Hi Simon,
I cannot see any probem.
Can you send us a screenshot and the broker you use?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 10:54
Hi Simon,
cBots and custom indicators are not available on cTrader Web, they are only available on cTrader Desktop.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 10:43
Hi Patrick,
Have you tried this on another computer? I cannot reproduce it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
16 Aug 2018, 10:25
Hi dicairo.bassem,
Commissions are deposited to your account each end of the day.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Aug 2018, 15:41
( Updated at: 21 Dec 2023, 09:20 )
Hi Lavio,
It seems there is some confusion here, let me but everything in points to clarify things.
1) cTrader Trade and cTrader Automate are located in different tabs and their charts do not interact. So if in one instance you use cTrader Trade tab and in the other instance you use cTrader Automate instance, there should be no confusion and performance issues. See example below
In the example above, I have two instances open, one for cTrader Trade and one for cTrader Automate. There is no interaction between the two. The above scenario behaves exactly as if you had cTrader and cAlgo running in parallel.
2) Regarding saving cBots, nothing has changed since version 2.0. cBots are installed locally and are available only on the computer that have been installed. You cannot see cBot instances in two different computers. That was the case in cTrader 2.0 as well.
3) I understand there is an issue If you open two instances of cTrader, then the chart settings that will be saved, no matter where they will be saved, workspace or locally, will be the settings of the instance that was closed last. So if you make changes in the cTrader Trade instance and close it before the cTrader Automate instance, then your changes might be overridden by the settings of the cTrader Automate tab. This is an issue and I will discuss it with the team. In the meanwhile, to avoid this you can always close the cTrader Trade instance last.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Aug 2018, 11:06
Hi mparama,
Try the code below
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter("OnBars", DefaultValue = "false")] public bool OnBars { get; set; } private CommodityChannelIndex cci; private string Label = "ReverseCCI"; protected override void OnStart() { // Put your initialization logic here } protected override void OnTick() { if (!OnBars) { var positionBuy = Positions.Find(Label, Symbol, TradeType.Buy); var positionSell = Positions.Find(Label, Symbol, TradeType.Sell); var cci2 = cci.Result.Last(2); var current_cci = cci.Result.Last(0); } } protected override void OnBar() { if (OnBars) { var positionBuy = Positions.Find(Label, Symbol, TradeType.Buy); var positionSell = Positions.Find(Label, Symbol, TradeType.Sell); var posBuy = Positions.FindAll(Label, Symbol, TradeType.Buy); var posSell = Positions.FindAll(Label, Symbol, TradeType.Sell); var cci2 = cci.Result.Last(2); var current_cci = cci.Result.Last(0); } } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Aug 2018, 09:27
Hi Lavio,
Regarding the two instances, cBots are not saved in workspaces. Therefore you should not expect to see the cBots you loaded on one computer being loaded in another computer. Also I was with the impression that you needed one instance for cTrader Trade and one for cTrader Automate, not two instances of cTrader Trade.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
14 Aug 2018, 09:11
Hi .ics
Are you able to reproduce this error? If yes, please share some code that will allow us to reproduce it as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Aug 2018, 12:04
Hi vanessakanu@ymail.com,
Thanks for posting in our forum. You can use F11 to switch layouts and hide the MarketWatch panel.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Aug 2018, 10:48
Ηι thongbaogiaodich,
If you want to save time from looping through positions and checking if there are buys and sells, I would propose to use counters for buy and sell on Positions.Opened and Positions.Closed events. This way you will avoid the loops. If you want, post the cBot code and I will make the modification for you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
13 Aug 2018, 10:17
Hi jsohail60,
Thanks for your reporting this. Could you please provide us with the information below?
- Does this happen before or after you log in with your cTrader ID?
- Can you please check the Console and let us know if there are any errors logged? You can open the Console by pressing Command+Option+I. Please send us a screenshot of the console
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 Aug 2018, 10:38
Hi fxwisdom1@gmail.com,
You have written the functions but you do not handle the events anywhere. Modify your OnStart as below
Best Regards,
Panagiotis
@PanagiotisCharalampous