Topics
Replies
1007601
07 Sep 2016, 04:55
RE:
mioulianou said:
when i start my bot in calgo after it opens some positions stops and recconecting!! This is happenig last 2 days! what is the problem?
thnks
I too have had problems with cAlgo logging off (on a VPS) and wonder if there has been a recent change?
Is it best to login using cTrader ID or your direct account details?
@1007601
1007601
02 Sep 2016, 16:01
RE: RE:
tmc. said:
kaliszczak1991 said:
Is there an option to set that robot to works only in some hours, lets say during London session?
Have a look at this thread: /forum/calgo-reference-samples/543
tmc, I'd like to "thumbs up" all of your posts -- thanks from everyone here!
@1007601
1007601
02 Sep 2016, 16:00
RE: RE: RE:
1007601 said:
ironmine said:
1007601 said:
I'm running cAlgo on a VPS server, signing in via my Ctrader ID. I would like to be able to "set and forget" but I have found each day or 2 that when I look I see that my account has logged out, or disconnected... Sometimes the bot still seems to be active but other times it seems to be not updating on the chart (and account info, etc).
Many thanks,G
Don't ever use cTrader ID, it's a buggy feature. Use the standard way to log in into your trading account.
Thanks for the replies -- I'm turning everything off this week (who knows what will happen !?!?!?) but I'll try this out on a demo...
So that was 19th June and I've had minimal problems since then until this week. The new version seems to default to opening a browser window to log in using cTrader ID; and you have to "force" the login using your account details by clicking manually.
It would be great to get some clarification about which events cause the platform to need new credentials. For example, I run a bot constantly in a VPS remote computer. I also login to ctrader on my phone and on my laptop (from 2x different locations). I also login to cAlgo on my laptop (from 2x different locations). Does any of these logins affect my remote VPS's login? If so, I can learn not to do this, but it hasn't been a problem for months and now suddenly it seems like it is.
Otherwise a great week!
@1007601
1007601
02 Sep 2016, 15:54
RE:
egi.messito said:
hi all
why drawing doesn t work in back testing?
it would be very useful for debugging. for instance i am trying to mark inside candles during backtesting and while it works in live mode it doesnt in backtesting
thanks
egi
Also, it would be *fantastic* to have an almost "bar by bar" playback of a backtest. To really dial in on the nittygritty of things. Even if just for a tiny segment (say 1 day) of a backtest. That would be priceless. That would allow additional time for the computer to process these drawing things to happen too.
@1007601
1007601
02 Sep 2016, 15:49
RE: RE:
zumzum said:
As long as spotware isn't able to fix the issue with changing candlesticks when refreshing the chart the benefit of higher tick periods is disputable anyway :(
andresort28 said:
cAlgo and cTrader should have the possibility to choose any timeframe in ticks, no only the diferent ticks options it has. The ideal would be that anyone could choose the period of ticks that would, for example (100 ticks), (250 ticks), (50 ticks), (1000 ticks), (3500 ticks), any period of ticks they want, in order to see the chart more accurate according to the price changing and not only by the time (which are the most common timeframes, but actually they are not so accurate).
It's been voted on before, but yep, 70 ticks would be great, or a custom version, like ProRealTime has.
@1007601
1007601
18 Aug 2016, 08:52
RE:
isakov2 said:
I dont have any expirience with programing, but i am trying a lot of time to comlete this cbot, but somthing wrong. take a look.thanks
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 RSIRangeRobotBoll : Robot
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("Stop Loss", DefaultValue = 10)]
public int StopLoss { get; set; }
[Parameter("Take Profit", DefaultValue = 15)]
public int TakeProfit { get; set; }
[Parameter("Volume", DefaultValue = 10000, MinValue = 1000)]
public int Volume { get; set; }
[Parameter("RSIPeriods", DefaultValue = 14)]
public int RSIPeriods { get; set; }
[Parameter("BandPeriods", DefaultValue = 20)]
public int BandPeriod { get; set; }
[Parameter("Std", DefaultValue = 3)]
public int std { get; set; }
[Parameter("MAType")]
public MovingAverageType MAType { get; set; }
[Parameter("Max Spread", DefaultValue = 5.0)]
public double MaxSpread { get; set; }
[Parameter("Buy", DefaultValue = true)]
public bool Buy { get; set; }
[Parameter("Sell", DefaultValue = true)]
public bool Sell { get; set; }
private RelativeStrengthIndex rsi;
private BollingerBands boll;
protected override void OnStart()
{
rsi = Indicators.RelativeStrengthIndex(Source, RSIPeriods);
boll = Indicators.BollingerBands(Source, BandPeriod, std, MAType);
}
protected override void OnTick()
{
if ((rsi.Result.LastValue < 30) && (Symbol.Bid < boll.Bottom.LastValue))
{
Print("****4****");
ExecuteMarketOrder(TradeType.Buy, Symbol, Volume);
}
else if ((rsi.Result.LastValue > 70) && (Symbol.Ask > boll.Top.LastValue))
{
Print("****5****");
ExecuteMarketOrder(TradeType.Sell, Symbol, Volume);
}
}
protected override void OnStop()
{
Print("****3****");
}
}
}
You could try changing "OnTick" to "OnBar"
Then also the "if" lines could read something like this:
bool a1 = rsi.Result.Last(1) < 30;
bool a2 = MarketSeries.Close.Last(1) < boll.Bottom.Last(1);
bool b1 = rsi.Result.Last(1) > 70;
bool b2 = MarketSeries.Close.Last(1) > boll.Top.Last(1);
if (a1 & a2)
{
// do your thing in here
}
if (b1 & b2)
{
//ditto
}
---
I didn't try the onTick method, but you might find you're entering a crazy number of trades that way. OnBar will make it happen once per time period.
Hope this helps!
@1007601
1007601
06 Aug 2016, 16:51
RE:
There might be a few ways:
(1) is to do a definite pip-position, the other is to have an overall account $ value for take profit:
I have tried this to find an average entry point of all positions, and then set a limit order:
// now recalculate average entry point; then setting a limit order for each position
// average entry +/- target;
double _avrgE = 0;
double _lotsE = 0;
double _Numm = 0;
double _tbP = 0;
foreach (var position1 in Account.Positions)
{
_avrgE = _avrgE + (position1.Volume * position1.EntryPrice);
_lotsE = _lotsE + position1.Volume;
if (position1.EntryPrice > highest_level) {highest_level = position1.EntryPrice;}
if (position1.EntryPrice < lowest_level) {lowest_level = position1.EntryPrice;}
}
// tradetype = buy;
if (DD == 1) // this is an overal value of direction of trade;
{
_tpB = Math.Round(_avrgE + Symbol.PipSize * _takeProfit, Symbol.Digits); //I had a pip size set to the _takeProfit variable
}
// tradetype = sell;
if (DD == 2) //ditto
{
_tpB = Math.Round(_avrgE - Symbol.PipSize * _takeProfit, Symbol.Digits); //ditto
}
// modify
foreach (var position in Account.Positions)
{
Trade.ModifyPosition(position, null, _tpB);
}
}
@1007601
1007601
07 Jul 2016, 16:45
RE:
moneybiz said:
Could you please state the min-max execution times of your broker and your connection latency from the right bottom corner.
You can get the info from the Positions tab by clicking on the left most icon (i) of each line.I'm testing the demo accounts of IC Markets which have execution times from 200ms to 300ms.
Latency to the server doesn't have any noticeable change on the execution time which is the reason I'm asking everybody to share their values.My values:
IC Market, Demo account, latency 17/25ms (Strasbourg-1 proxy), execution time 200-300ms.
IC Market, Demo account, latency 40/40ms (Strasbourg-1 proxy), execution time 200-300ms.The slippage limit is 1 pip for EUR/USD which doesn't exceed on normal market conditions.
Didn't know I had access to this info, so thanks!
Pepperstone: live account:
(1) home interenet connection; latency 16/210ms; execution time 115ms
(2) VPS: latency 0.8/35ms; execution time 112ms...
The range seems to be 109-119ms...
@1007601
1007601
19 Jun 2016, 14:27
RE: RE:
ironmine said:
1007601 said:
I'm running cAlgo on a VPS server, signing in via my Ctrader ID. I would like to be able to "set and forget" but I have found each day or 2 that when I look I see that my account has logged out, or disconnected... Sometimes the bot still seems to be active but other times it seems to be not updating on the chart (and account info, etc).
Many thanks,G
Don't ever use cTrader ID, it's a buggy feature. Use the standard way to log in into your trading account.
Thanks for the replies -- I'm turning everything off this week (who knows what will happen !?!?!?) but I'll try this out on a demo...
@1007601
1007601
10 Jun 2016, 14:54
RE:
Ermisl said:
Thank you for your prompt answer.
I hope those are implemented as soon as possible so as to provide an undistorted view of the efficiency of trader's strategies.
Keep up the good work.
Good to know, I guess it's up to us to include this...
Just read about: /api/reference/internals/iaccount
ie. account.freemargin etc
@1007601
1007601
29 Mar 2016, 13:05
RE:
That's great, thanks !!
My problem was the x-axis; but also lacking the patience to experiment by running it live... weekends were the best time to try it but the markets weren't live !
Cheers,
GH
solark said:
Yes each point needs to have a unique ID in the context of the chart. Maybe just something like `"Label_Dot_" + count` where count is incremented everytime you draw an object. This may be what you're after.
... private double lastAverage = 0.0; private int count = 0; ... protected override void OnBar() { var positions = Positions.FindAll("label", Symbol); if(positions.Length > 0) { var avg = positions.Average(x => x.EntryPrice); ChartObjects.DrawLine("label_dot" + count.ToString(), MarketSeries.OpenTime.Last(1), lastAverage, MarketSeries.OpenTime.Last(0), avg, Colors.DarkGray, 2, LineStyle.Dots); lastAverage = avg; count++; } else { lastAverage = 0.0; } }There will be a vertical line on entry, but you could work around that by checking if lastAverage is zero. This would be connected dotted lines, if you want dots you could just do shorten up the line and increase the thickness.
@1007601
1007601
28 Mar 2016, 13:58
RE:
croucrou said:
Thanks for your reply. I regret it is not possible to do within just one line.
I try to have a "bool" condition that matches the conditions for entry...
ie.
if (c1 & c2 & c3 & c4 ... & c6)
{
do that thing!
}
; so one of the "bool" conditions could be
bool c5 = positions.Count < 100;
So that would mean all the conditions need to be met, ONE of them being the positions.count is less than your value; in this case I said 100.
I'm never sure if it looks clumsier in script or not; its functional for me...
GH
@1007601
1007601
28 Mar 2016, 13:40
RE: RE:
Cerunnos said:
cAlgo_Development said:
In nearest future we are going to implement an ability to restarts robots automatically when cAlgo is restarted.
This planned feature is a must in VPS systems and would contribute to greater safety. Hopefully it is coming very soon (for example as an NT service with parameter ) ...
Agree with this;
I've noticed some "odd" behaviour of my calgo logging in and out which I'm pretty sure means the bot is no longer running. I hadn't set up alerts for *this* but after noticing some other odd behaviour I ensured that there were always limit exits and stops in case some unexpected event happened (anywhere in the signal chain) and I wasn't hoping for a responsive algo to close all positions !!! [which BTW works fantastically in backtesting :) ]
@1007601
1007601
14 Feb 2016, 17:21
RE:
alistadd said:
Hello, can someone please help me i want exact 5 dollars profit for all positions algo,
needs to close all positions sometimes 6 open it needs to be exact don't want to have to change any parameters or anything it would really help me thankyou
I just want to be able to creat new algo paste your algo and then play , i tried others but it think it was left to a bit to myself to put unrealised profit here or there it doesn't work.
I just want 5 dollars profit for all positions close profit for all positions thanks
Would something like:
bool c1 = Account.Equity > Account.Balance + 5;
if (c1)
{
//close all positions here!?!
}
@1007601
1007601
14 Feb 2016, 16:49
RE: RE:
This works!
I'm wondering how many other people have had trouble with this. My cAlgo and cTrader stopped working for "no reason" a while ago and I'd almost given up on the whole platform. I contacted my broker (Pepperstone, where I downloaded the software) without reply!
I opened a crappy old laptop (out of desperation) and found it was able to load the updates no problem. I followed the steps outlined above and things have gone swimmingly for the 5 or 10 minutes since.
This should be more prominent!
KEYWORDS: CALGO NOT WORKING, CTRADER NOT WORKING, UNINSTALL CTRADER, UNINSTALL CALGO, etc etc etc
@1007601
1007601
08 Sep 2016, 05:46
RE: RE: RE: RE:
1007601 said:
...bump...
would be great to seek clarification about constant need to re-log in
@1007601