Topics
Replies
ctid3999979
19 Dec 2021, 12:15
( Updated at: 19 Dec 2021, 13:15 )
RE:
ctid3999979 said:
Hi
I've spent the morning trying to create a VM in Azure to run cTrader (we use Azure at work so RDP to it is allowed through the firewall), however, even though I can get to the IC Markets website and the software download when running the installer, when I try to log in, I get a connection error. I can log in fine from my home computer. My Network Security Groups allow traffic out to the internet.
Has anyone tried to do this and point me in the right direction to get connectivity via Azure?
I've done substantial testing throughout yesterday and today.
I've created virtual environments in UK South, EU West and Japan East. All of them have failed to connect when trying to log in.
I performed a packet capture when attempting a login and got Connection Reset By Peer packets returned from the following IP addresses:
- 128.199.81.140
- 107.191.52.140
- 108.61.182.11
- 172.104.120.200
- 103.53.199.199
- 47.91.111.144
- 47.91.110.250
- 103.53.199.226
- 172.105.201.144
- 103.200.6.105
These IP address are registered to cTrader.com. This means that the servers are dropping my connection when attempting to log in.
I've also created a VM in Amazon Web Services and that worked without any problem at all.
Are Azure networks blocked from connecting to cTrader services?
@ctid3999979
ctid3999979
07 Jul 2021, 12:37
RE:
amusleh said:
The symbol sessions gives you the time of week that you can trade the symbol not the trading session you are after. if you want to trade on specific time period of the day you can use the server time and if its in your trading range you can execute your trading operations, ex:
using cAlgo.API; using System; using System.Globalization; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)] public class TradeTime : Robot { private TimeSpan _startTime, _endTime; [Parameter("Start Time", DefaultValue = "07:00:00", Group = "Time Filter")] public string StartTime { get; set; } [Parameter("End Time", DefaultValue = "16:00:00", Group = "Time Filter")] public string EndTime { get; set; } private DateTime CurrentTime { get { return Server.TimeInUtc.Add(-Application.UserTimeOffset); } } private bool IsTimeCorrect { get { return (_startTime > _endTime && (CurrentTime.TimeOfDay >= _startTime || CurrentTime.TimeOfDay <= _endTime)) || (_startTime < _endTime && (CurrentTime.TimeOfDay >= _startTime && CurrentTime.TimeOfDay <= _endTime)); } } protected override void OnStart() { if (!TimeSpan.TryParse(StartTime, CultureInfo.InvariantCulture, out _startTime)) { Print("Invalid start time input"); Stop(); } if (!TimeSpan.TryParse(EndTime, CultureInfo.InvariantCulture, out _endTime)) { Print("Invalid end time input"); Stop(); } } protected override void OnBar() { // Return if current time is not in start/end time range if (!IsTimeCorrect) return; } } }
Thanks for the quick response and clarification. I'd read an older post about using the server time but wasn't sure if the API had been updated since then.
@ctid3999979
ctid3999979
07 Jul 2021, 12:00
RE:
PanagiotisCharalampous said:
Hi ctid3999979,
You are passing the wrong source to the MAs. It needs to be DataSeries, not Bars. See below
// Initiate Exponential Moving Averages for 15 minute TimeFrame ma1ExpMovingAverage = Indicators.MovingAverage(data1Min.ClosePrices, ma1Period, ma1Type); ma2ExpMovingAverage = Indicators.MovingAverage(data5Min.ClosePrices, ma2Period, ma2Type); ma3ExpMovingAverage = Indicators.MovingAverage(data15Min.ClosePrices, ma3Period, ma3Type);
Best Regards,
Panagiotis
Thanks a lot. I knew it would be something simple.
@ctid3999979
ctid3999979
20 Dec 2021, 15:06 ( Updated at: 20 Dec 2021, 15:14 )
RE:
PanagiotisCharalampous said:
No because all other internet traffic works fine, it's just communication to your IP addresses which isn't working.
I thought it logical to contact you first as as everything else doesn't have a problem.
@ctid3999979