Topics
Replies
deansi
21 Mar 2017, 12:54
RE:
Spotware said:
Dear Trader,
Please note that we calculate Indicators on demand. If you do not access IndicatorDataSeries from the cBot the Calculate() method will not be invoked. Please use DataSeries instead of double fields.
So just to clarify the meaning of "access IndicatorDataSeries", if I had the code with a custom indicator in a cBot as below example:
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } private TEMA tema; // custom indicator protected override void OnStart() { var prevBars = MarketData.GetSeries(TimeFrame); tema = Indicators.GetIndicator<TEMA>(prevBars.Close, maPeriods); // THIS IS EXAMPLE A. } protected override void OnBar() { double resultMA = tema.Result.Last(1) // THIS IS EXAMPLE B. } }
The line in the code where I have the comment "EXAMPLE A", is that enough to meet the requirement of accessing the IndicatorDataSeries on each bar, or does it require the line at "EXAMPLE B" in OnBar also? (as OnTick would I assume also)
@deansi
deansi
06 Mar 2017, 05:24
Caution this code may open trades every bar..!
I wouldnt run this live, it looks like the lines in the second bot:
//================================================================================ protected override void OnBar() { if (Positions.Count < MaxPositions) { if (Volume > VolumeMax) { Volume = VolumeMax; } ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, MyLabel, StopLoss, TakeProfit); ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, MyLabel, StopLoss, TakeProfit); } } //================================================================================
would open a trade in both directions every single bar regardless of any input file or copy trades. In other words it wont do what it says and will empty your account.!
@deansi
deansi
27 Dec 2016, 02:53
RE:
Sorry my example code was duplicate, it should have been:
///So the line of code Ive changed goes from this: ChartObjects.DrawLine("Ck T"+ MarketSeries.OpenTime.Last(1).ToString(), MarketSeries.OpenTime.Last(1), MarketSeries.High.Last(1) + (dtr.Result.Last(1)*0.1), MarketSeries.OpenTime.Last(1), MarketSeries.High.Last(1) + (dtr.Result.Last(1)*0.15), chkTCol, 3, LineStyle.Solid); To This: ChartObjects.DrawLine("Ck T"+ MarketSeries.OpenTime.Last(1).ToString(), index-1, MarketSeries.High.Last(1) + (dtr.Result.Last(1)*0.1), index-1, MarketSeries.High.Last(1) + (dtr.Result.Last(1)*0.15), chkTCol, 3, LineStyle.Solid);
@deansi
deansi
05 Dec 2015, 20:23
Maybe Ill just hack a way to supply my own tick data... seems faster than waiting for spotware to add the option, which seems so easy to implement from their end, there is already 1min data possible to import, how hard can ticks be to add.?
Anyone looked into hacking the tick data files made by calgo of the *.tdbc file extension?
It looks possible after a brief look into it
g.wizzip
Anywho...
@deansi
deansi
05 Dec 2015, 20:15
Most of the votes here should now be on the other thread because this one is considered fixed,
This feature is just for tick backtesting from the broker supplied tick data. you still cannot put your own tick data into calgo for backtesting.
Try this feature request page if you want to vote for the additional option:
http://vote.spotware.com/forums/229166-ideas-and-suggestions-for-ctrader-and-calgo/suggestions/5196593-import-tick-data-for-market-replay-or-backtesting
@deansi
deansi
03 Dec 2015, 22:59
Still need this feature, the server tick data is now limited to about 3 years back and 2 days from present day. Which is good, but still limiting in some ways. (why the last 2 days data isnt there for ticks I cant explain)
Its also limiting because you cant currently put in custom data to test a cbot against theoretical data, for example to debug a cbot.
But anyway, if you just add the function of tick backtesting from csv file, all this above can be worked around by us that need it.
@deansi
deansi
21 Sep 2015, 12:08
If I can recommend, what would be good for programmers and calgo servers would be the possible option to get a specific range of bars directly from the server and maybe to be able to specify only open, close, vol, bar time etc. this makes looking back through recent history concise, and also save download data overheads for your servers.
I know right now you get +1000 bars of data if you access MarketData, and all the O,H,L,C,V, times of all those 1000+ bars, not so efficient.
@deansi
deansi
19 Apr 2015, 02:11
So money management on a multi symbol strategy becomes a guessing game.
I have a multi symbol cbot that so far looks to be profitable, but can only guess what the drawdown will be over a year since I cant backtest more than one symbol at a time :( Mathematically to calculate this manually is near impossible (need to compare every tick when there is a trade open on more than one symbol to get the worst case drawdown) , only the platform has a chance of doing this calculation if implemented.
Really need this feature..! :)
@deansi
deansi
16 Feb 2015, 23:01
cAlgo has 4 years of data on my platform for the 5min chart. What you might be talking about is ctrader viewable chart which is about 1 month, I suggest just install cAlgo and use backtest of a example strategy, you should have access to the 4 years of 5 min data Im talking about.
@deansi
deansi
05 Dec 2014, 17:04
RE:
Spotware said:
History tab displays only closed positions. If position was not closed during backtesting it will not be shown in History tab, however not closed positions affect several fields in Trade Statistics tab: Ending Equity, Max Equity Drawdown.
I see that it does show in those couple of spots, so its not a bug, but this is a little counter intuitive by being hard to see the result if you have any positions open at the end of a backtest period, Other platforms ive used just close all open trades at the end of backtesting to show results more obviously.
As most peoples eye would first look at 4 important numbers like net profit, total trades, max equity drawdown, max balance drawdown, but only 1 of those 4 reflect the unclosed positions gains / losses, Is there any plan to change this behavior?
@deansi
deansi
05 Dec 2014, 04:30
( Updated at: 21 Dec 2023, 09:20 )
Hi support,
I get a problem where the most recent 1 to 2 days of data in m1 data from server works but doesnt work.
What happens is trades should have happened, and the trades show up in the "Log" tab, but they dont show in the "History" tab or in the "trade statistics" tab, the images below shows 2 trades should have opened at 17:35 and 17:40, but dont show in the history tab. Ive highlighted in blue box the 2 m5 bars that should have traded on. The log tab shows the server messages of trade accepted.
:As you can see in the next pic there is no trade at the specified times 17:35 and 17:40
thius is set to m1 data from server, it may have something to do with the way that the server wont even backtest with tick data in teh last 1 - 2 days, which is a limitation that isnt preffered either.
@deansi
deansi
05 Dec 2014, 04:19
I get a similar problem, after optimization runs especially if doing some runs in the backtesting tab at the same time, or if I put the computer to suspend and resume the session calgo can keep using cpu when the runs are all finnished, and the responsiveness of the calgo platform gets super hard to use taking 10 - 20 seconds just to change tabs or do anything at all.
I have to restart the platform to make it act normal again, but then I lose my results charts and windows :( Ive tried different priority settings but doesnt really do much.
@deansi
deansi
25 Mar 2017, 13:11
RE:
cbellew said:
Can someone elaborate on what this roughly equates to in dollars?
Like for example on EURUSD my broker comission is equivalent to about 0.6 to 0.7pips, or $28USD per million (or 10 lots)
What kind of numbers are we talking about for this QUOTE/HOME rate?, and if I understand it right the backtests DONT include this expense and hence are making the backtest results look better than they really are?
@deansi