general help
Created at 22 May 2015, 14:28
general help
22 May 2015, 14:28
Is there a good reference for this calgo library? This on this site is bad because it doesnt tell anything e.g. where some method belongs ... the Differences between Indicator and cbot.. Methods for Indicators like MarketDepth belongs in Initialzation() but in cbot in OnStart() it doesnt work...
E.g I know how to implement depthofmarket in an Indicator but in the cbot? How can I manage this?
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 dom : Robot { private MarketDepth _marketDepth; protected override void onStart() { // Get Market Depth _marketDepth = MarketData.GetMarketDepth(Symbol); // subscribe to event Updated _marketDepth.Updated += MarketDepthUpdated; } void MarketDepthUpdated() { double sum_bid = 0; double sum_ask = 0; double bid_vol = 0; double ask_vol = 0; foreach (var entry in _marketDepth.BidEntries) { double entryPrice = entry.Price; sum_bid = sum_bid + entryPrice; } } protected override void OnTick() { // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } }
Spotware
15 Jun 2015, 15:28
Dear Trader,
The error is, that you wrote the OnStart() method with a small letter “onStart()” is not recognized.
@Spotware