Topics
Replies
botmaster
30 May 2015, 06:12
Damn.. I wish there was a way to remove post. It was my mistake after all. I was using the wrong period. dah!
... going to get another beer.
@botmaster
botmaster
30 May 2015, 06:03
Here is what I did to solve the problem.
private bool okToStart = true; protected override void OnTimer() { // Do Trading here. Your values will be different. } protected override void OnBar() { if (okToStart) { Timer.Start(1800); // every 30 mins okToStart = false; } }
@botmaster
botmaster
29 May 2015, 00:08
RE:
Gman89 said:
This is quite a big deal for a lot of strategies. Does anyone know of a good work around at least? Both for historical OHLC and present time. It's not enough to just add spread/2 to the values as highs and lows will be at different times with different bids and asks compared to when you ask the value.
I agree, in fact I'm currently porting my system from another platform to give cAlgo a try. The custom back-testing engine I wrote uses the bid and ask to determine P/L. Now, that I'm moving things over to a cBot, I'm rather concerned that back-testing will not be nearly as accurate with bid only values.
@botmaster
botmaster
28 May 2015, 16:32
RE:
deklin said:
This does not work. How can I do it?
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = "B")] public string[3] ABC {"A", "B", "C"} protected override void OnStart() { Print(ABC); } } }hmm.. I don't have the platform in front of me. Have you tried an Enum?
enum enmABC{ A, B, C}; [Parameter(DefaultValue = enmABC.A)] public enmABC ABC;
https://msdn.microsoft.com/en-us/library/sbbt4032.aspx
@botmaster
botmaster
27 May 2015, 23:26
( Updated at: 21 Dec 2023, 09:20 )
RE:
deklin said:
Is there a way to create a list of options to appear in a dropdown for parameters?
Like this?
Have you tried inline arrays?
s1 = new string[3] {"John", "Paul", "Mary"};
@botmaster
botmaster
27 May 2015, 23:23
RE: RE:
botmaster said:
JeremyG said:
Did you try using Open.LastValue instead of Open.Last(0) etc?
Yes, that returns the same value too.
So far I've moved my code to the OnTimer event and started the timer on the first OnBar(). This ensures that all the values are different. They are not exactly the same as the indicator values, but they are close enough to be useful.
@botmaster
botmaster
27 May 2015, 23:19
RE: RE:
Gman89 said:
Spotware said:
I am printing Symbol.Ask, Symbol.Bid and MarketSeries.Close.LastValue on every tick and noticed that MarketSeries.Close.LastValue and Symbol.Bid values are always same and also MarketSeries.TickVolume.LastValue is coming as some incremental values.
This should not be the case as this would mean that we always have bid side trades.
MarketSeries.Close is built based on bid prices only.
And also MarketSeries.TickVolume.LastValue doesn't seem to have the correct values.
MarketSeries.TickVolume shows number of bid changes for historical trendbars.
Does it help?
If you wanted to use MarketSeries to utilize mid price, what would be the best workaround? I ask because the value for open, high and low based on mid price movement are important in my algo's. This also means initializing my historical window based on mid for my indicators on start.
See here:
/forum/calgo-support/5340
It would be nice of a MarketSeries data contained all 8 values like other platforms do. AskClose, BidClose, AskHigh, BidHigh, etc...
@botmaster
botmaster
27 May 2015, 17:00
RE:
JeremyG said:
Did you try using Open.LastValue instead of Open.Last(0) etc?
Yes, that returns the same value too.
@botmaster
botmaster
25 May 2015, 19:01
I'm also experiencing the same issue. The problem is that for the current Tick or Bar the values are all the same. (i.e Open = Close = High = Low. )
You would think that cBot would be using the same values as the indicator, but for some reason it doesn't.
At first I didn't notice this issue because indicators like the SampleSMA are only using one data Source for the current tick or bar.
As an experienced programmer, but a newbie to cBot I just can't figure out why Calculate(int index) works from a different dataset than OnBar(). The values returned via indicators to cBot are not the same. It would be nice if there was more documentation to explain these differences.
@botmaster
botmaster
25 May 2015, 17:22
Just to be more clear.
I'm saying that for the current bar
Open.Last(0) = Close.Last(0) = High.Last(0) = Low.Last(0) which doesn't make much sense to me.
@botmaster
botmaster
24 May 2015, 22:00
Hmm I deleted my Cache and it's working now.
\AppData\Roaming\pepperstone cAlgo\Cache
@botmaster
botmaster
24 May 2015, 21:54
RE: RE:
tradermatrix said:
botmaster said:
Is backtesting only available when the trading session is active? My button play-button is grayed out.
no .... it's a failure or an update (this morning) ...
it works with some brokers ..
cordially
The play button doesn't work for any bot. Pepperstone cAlgo hasn't worked since Friday. I guess there was an update that broke it all.
@botmaster
botmaster
24 May 2015, 21:44
I'm having the same issue. None of my bots will play (not even the sample bots) it hasn't worked since Friday night.
@botmaster
botmaster
19 Jun 2015, 19:58
I'd like to know when the documentation will be updated to explain why graph (indicator) values and log values are different. At least provide adequate documentation that explains how MarketData is created/returned for each event OnBar(), OnTick(), etc . There are many unanswered threads on this forum that are asking this very question.
@botmaster