array out of bounds exception in OnTick() before first statement!
array out of bounds exception in OnTick() before first statement!
15 Jul 2015, 09:23
Greetings All;
I have a cBot I am building and am getting the following error, however it shows up before the first statement in OnTick(), which is a Print() statement for debugging purposes. I don't know how to isolate the exception because it prints to the log before the message to be printed by the first statement. It doesn't occur on the first iteration of the program since it opens and closes a position on the backtester before running into this problem.
The error:
02/06/2015 08:47:00.000 | Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array.
The OnTick() starts like:
protected override void OnTick()
{
Print("begining of OnTick()");//, allPositions.Length);
...
any good suggestions would be appreciated, I'm at a loss.
-Roni
Replies
aharonzbaida
19 Jul 2015, 01:32
RE:
Spotware said:
Dear Trader,
Could you please send us your code at troubleshooting@spotware.com. We will use it only for troubleshooting purposes.
I sent
@aharonzbaida
aharonzbaida
19 Jul 2015, 01:35
RE:
Makagon said:
give all code, i send where is error.
// ------------------------------------------------------------------------------------------------- // Modified cBot Roni // plan of action: 1st build LRSBB_ind as basis for this cBot // pingpong adverse exit // -------------------------------------------------------------- // 13 July looks like close all doesn't work or never reaches, see log for print statements - problem that backtester didnt get result of ClosePositionAsynch // 14 July : 02/06/2015 10:04:00.000 | Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array. // 15 July could not yet debug - sent request to ctdn forum 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 ModifiedcBotRoni : Robot { [Parameter("Initial Target Pips", DefaultValue = 15)] public int initTargetPips { get; set; } [Parameter("Symetric Half Zone Pips", DefaultValue = 15)] public int halfZone { get; set; } [Parameter("Symetric Targets Beyond Zone Pips", DefaultValue = 15)] public int targetBeyondZone { get; set; } //[Parameter()] //public DataSeries SourceSeries { get; set; } [Parameter(DefaultValue = 1000, MinValue = 1000)] public int Volume { get; set; } //private MovingAverage slowMa; //private MovingAverage fastMa; private const string label = "Roni Trend cBot"; private bool pingPongActivated = false; private Position[] allPositions; //array of positions //Position[] longPositions; //to hold long positions //Position[] shortPositions; //to hold short positions protected override void OnStart() { //fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MovingAverageType.Simple); //slowMa = Indicators.MovingAverage(SourceSeries, SlowMAPeriods, MovingAverageType.Simple); UpdatePositionsArray(); } protected override void OnTick() { Print("begining of OnTick()"); //, allPositions.Length); //Print("Symbol.PipSize={0}", Symbol.PipSize); //Print("Symbol.PipValue={0}", Symbol.PipValue); //Print("Symbol.Digits={0}", Symbol.Digits); //Print("Symbol.TickSize={0}", Symbol.TickSize); //Print("Symbol.TickValue={0}", Symbol.TickValue); //Print("Symbol.VolumeStep={0}", Symbol.VolumeStep); //Print("Symbol.VolumeMin={0}", Symbol.VolumeMin); //Print("Symbol.VolumeMax={0}", Symbol.VolumeMax); //store open positions in arrays UpdatePositionsArray(); //for this cBot on this symbol //longPositions = Positions.FindAll(label, Symbol, TradeType.Buy); //shortPositions = Positions.FindAll(label, Symbol, TradeType.Sell); if (allPositions.Length == 0) { //if no open position, seek entry pingPongActivated = false; //if no positions yet, then pingpong exit is off CheckForEntry(); //if only one position } //if exactly one position is open else if (true) { //if adversely moved past zone, activate PingPongExit() if (allPositions.Length == 1 && allPositions[0].Pips <= -halfZone) { pingPongActivated = true; PingPongExit(); } //... and reached t/p, close) if (allPositions.Length == 1 && allPositions[0].Pips >= initTargetPips) { //close if reached t/p ClosePosition(allPositions[0]); //ClosePositionAsync(allPositions[0]); pingPongActivated = false; } } //more than one leg open - call PingPongExit() if (allPositions.Length > 1) { pingPongActivated = true; PingPongExit(); } if (pingPongActivated) PingPongExit(); } //OnTick() private void UpdatePositionsArray() { allPositions = Positions.FindAll(label, Symbol); // PrintAllPositions(allPositions); } private void PrintAllPositions(Position[] ap) { //Print("ap.len=",ap.Length); //if (ap.Length>0) //{ foreach (var pos in ap) { Print(pos.Id, ", ", pos.TradeType, ", ", pos.Volume, ", ", pos.Label, ", ", pos.Comment); Print("-----------------------------------------"); } Print("at end of PrintAllPositions()"); //} } private void PingPongExit() { //Print("hello from pingpong: {0}", allPositions[0].ToString()); //calculate zone and targets based on initial entry double lowerZoneBoundry = allPositions[0].EntryPrice - halfZone * Symbol.PipSize; //is a price level double upperZoneBoundry = allPositions[0].EntryPrice + halfZone * Symbol.PipSize; //is a price level double upperTarget = upperZoneBoundry + targetBeyondZone * Symbol.PipSize; //is a price level double lowerTarget = lowerZoneBoundry - targetBeyondZone * Symbol.PipSize; //is a price level //if price moves beyond upper zone boundry - rebalance for b/e or better on the upper target (ask price) //else if price moves beyond lower zone boundry - rebalance for b/e or better on the lower target (bid) if (Symbol.Ask >= upperZoneBoundry) { //re-balace positions to break-even or better on upperTarget //GetPLatUpperTarget(upperTarget) //gets P/L sum of all open positions at upper target //GetVolumeToBrkEvn(GetPLatUpperTarget(upperTarget), upperTarget) //gets volume required to break even at price in 2nd parameter (the target) long vol = GetVolumeToBrkEvn(GetPLatTarget(upperTarget), targetBeyondZone); //////Print("vol returned = {0}", vol); var tr = ExecuteMarketOrder(TradeType.Buy, Symbol, vol); //Print("tradeResult ={0}", tr.ToString()); } if (Symbol.Bid <= lowerZoneBoundry) { //re-balace positions to break-even or better on upperTarget //GetPLatUpperTarget(upperTarget) //gets P/L sum of all open positions at upper target //GetVolumeToBrkEvn(GetPLatUpperTarget(upperTarget), upperTarget) //gets volume required to break even at price in 2nd parameter (the target) long vol = GetVolumeToBrkEvn(GetPLatTarget(lowerTarget), targetBeyondZone); //Print("vol returned = {0}", vol); var tr = ExecuteMarketOrder(TradeType.Sell, Symbol, vol); //Print("tradeResult ={0}", tr.ToString()); } //update positions array UpdatePositionsArray(); //is last position at target? if (Symbol.Bid >= upperTarget || Symbol.Ask <= lowerTarget) { Print("before close all"); PrintAllPositions(allPositions); CloseAllPositionsThisBotAndSymbol(); Print("after close all"); PrintAllPositions(allPositions); } //if (allPositions[allPositions.Length - 1].TradeType == TradeType.Buy) //{ // if (Symbol.Bid >= upperTarget) // { // CloseAllPositionsThisBotAndSymbol(); // } //} //else if (allPositions[allPositions.Length - 1].TradeType == TradeType.Sell) //{ // if (Symbol.Ask <= lowerTarget) // { // CloseAllPositionsThisBotAndSymbol(); // } //} } private void CloseAllPositionsThisBotAndSymbol() { UpdatePositionsArray(); foreach (var pos in allPositions) { Print("hello from closeAll..."); TradeResult tr = ClosePosition(pos); //ClosePositionAsync(pos); Print(tr.ToString()); } UpdatePositionsArray(); } //PingPongExit() private double GetPLatTarget(double priceTarget) { //this method calculates sum of profit loss from all open positions including commissions at target price double plSum = 0.0; foreach (var pos in allPositions) { double pips2target = pos.TradeType == TradeType.Buy ? (priceTarget - pos.EntryPrice) / Symbol.PipSize : (pos.EntryPrice - priceTarget) / Symbol.PipSize; double posPL = pips2target * pos.Volume * Symbol.PipValue + pos.Commissions + pos.Swap; //are commission and swap values reported (-) vlaues? plSum += posPL; ////string s = "GetPLatTarget(): \n" + "pips2target= " + pips2target.ToString() + "\n" + "allPositions.Length = " + allPositions.Length.ToString() + "\n" + "Position: ID:" + pos.Id.ToString() + ", " + pos.TradeType.ToString() + ", vol:" + pos.Volume.ToString() + "\n" + "Pos. Com.: " + pos.Commissions + "\n" + "Pip value: " + Symbol.PipValue + "\n" + "Pos. P/L at Target: " + posPL.ToString() + "\n" + "Pos's P/L Sum: " + plSum.ToString(); //Print(s); } return plSum; } private long GetVolumeToBrkEvn(double pl, int pipsToTarget) { //this method return required volume to break even or better at price target including commissions (excluding swap) //and considering mininimum trade volume increments //where pl is P/L to overcome, and //pipsToTarget is number of pips from zone extereme to exit target double temp = pl / (pipsToTarget * Symbol.PipValue); double t2 = temp / 1000; //get lots of 1000 double t3 = pl + t2 * 0.18; //commission $0.09 each direction per 1000 assumed temp = t3 / (pipsToTarget * Symbol.PipValue); //string s = "pl = " + pl.ToString() + "\n" + "pipsToTarget = " + pipsToTarget.ToString() + "\n" + "temp/1000=volume = " + (temp / 1000).ToString() + "\n" + "Symbol.NormalizeVolume(temp/1000, RoundingMode.Up) = " + Symbol.NormalizeVolume(temp / 1000, RoundingMode.Up).ToString(); //Print("hello from GetVolumeToBrkEvn \n{0}", s); return Symbol.NormalizeVolume(temp, RoundingMode.Up); } //entry rules //reached here if no positions open private void CheckForEntry() { //enter random Random r = new Random((int)DateTime.Now.Ticks & 0xffff); int dir = r.Next(-1, 2); if (dir > 0) { ExecuteMarketOrder(TradeType.Buy, Symbol, 1000, label, null, null, null, "1st"); } else if (dir < 0) { ExecuteMarketOrder(TradeType.Sell, Symbol, 1000, label, null, null, null, "1st"); } else return; } //CheckForEntry() } //class ModifiedcBotRoni } //namespace cAlgo
Below is copy of lof from back test:
02/06/2015 00:00:00.000 | Backtesting started
02/06/2015 00:01:00.000 | begining of OnTick()
02/06/2015 00:01:00.000 | Executing Market Order to Buy 1k GBPJPY
02/06/2015 00:01:00.000 | → Executing Market Order to Buy 1k GBPJPY SUCCEEDED, Position PID1
02/06/2015 00:02:00.000 | begining of OnTick()
02/06/2015 00:03:00.000 | begining of OnTick()
02/06/2015 00:04:00.000 | begining of OnTick()
02/06/2015 00:05:00.000 | begining of OnTick()
02/06/2015 00:06:00.000 | begining of OnTick()
02/06/2015 00:07:00.000 | begining of OnTick()
02/06/2015 00:08:00.000 | begining of OnTick()
02/06/2015 00:09:00.000 | begining of OnTick()
02/06/2015 00:10:00.000 | begining of OnTick()
02/06/2015 00:11:00.000 | begining of OnTick()
02/06/2015 00:12:00.000 | begining of OnTick()
02/06/2015 00:13:00.000 | begining of OnTick()
02/06/2015 00:14:00.000 | begining of OnTick()
02/06/2015 00:15:00.000 | begining of OnTick()
02/06/2015 00:16:00.000 | begining of OnTick()
02/06/2015 00:17:00.000 | begining of OnTick()
02/06/2015 00:18:00.000 | begining of OnTick()
02/06/2015 00:19:00.000 | begining of OnTick()
02/06/2015 00:20:00.000 | begining of OnTick()
02/06/2015 00:21:00.000 | begining of OnTick()
02/06/2015 00:22:00.000 | begining of OnTick()
02/06/2015 00:23:00.000 | begining of OnTick()
02/06/2015 00:24:00.000 | begining of OnTick()
02/06/2015 00:25:00.000 | begining of OnTick()
02/06/2015 00:26:00.000 | begining of OnTick()
02/06/2015 00:27:00.000 | begining of OnTick()
02/06/2015 00:28:00.000 | begining of OnTick()
02/06/2015 00:29:00.000 | begining of OnTick()
02/06/2015 00:30:00.000 | begining of OnTick()
02/06/2015 00:31:00.000 | begining of OnTick()
02/06/2015 00:32:00.000 | begining of OnTick()
02/06/2015 00:33:00.000 | begining of OnTick()
02/06/2015 00:34:00.000 | begining of OnTick()
02/06/2015 00:35:00.000 | begining of OnTick()
02/06/2015 00:36:00.000 | begining of OnTick()
02/06/2015 00:37:00.000 | begining of OnTick()
02/06/2015 00:38:00.000 | begining of OnTick()
02/06/2015 00:39:00.000 | begining of OnTick()
02/06/2015 00:40:00.000 | begining of OnTick()
02/06/2015 00:41:00.000 | begining of OnTick()
02/06/2015 00:42:00.000 | begining of OnTick()
02/06/2015 00:43:00.000 | begining of OnTick()
02/06/2015 00:44:00.000 | begining of OnTick()
02/06/2015 00:45:00.000 | begining of OnTick()
02/06/2015 00:46:00.000 | begining of OnTick()
02/06/2015 00:47:00.000 | begining of OnTick()
02/06/2015 00:48:00.000 | begining of OnTick()
02/06/2015 00:49:00.000 | begining of OnTick()
02/06/2015 00:50:00.000 | begining of OnTick()
02/06/2015 00:51:00.000 | begining of OnTick()
02/06/2015 00:52:00.000 | begining of OnTick()
02/06/2015 00:53:00.000 | begining of OnTick()
02/06/2015 00:54:00.000 | begining of OnTick()
02/06/2015 00:55:00.000 | begining of OnTick()
02/06/2015 00:56:00.000 | begining of OnTick()
02/06/2015 00:57:00.000 | begining of OnTick()
02/06/2015 00:58:00.000 | begining of OnTick()
02/06/2015 00:59:00.000 | begining of OnTick()
02/06/2015 01:00:00.000 | begining of OnTick()
02/06/2015 01:01:00.000 | begining of OnTick()
02/06/2015 01:02:00.000 | begining of OnTick()
02/06/2015 01:03:00.000 | begining of OnTick()
02/06/2015 01:04:00.000 | begining of OnTick()
02/06/2015 01:05:00.000 | begining of OnTick()
02/06/2015 01:06:00.000 | begining of OnTick()
02/06/2015 01:07:00.000 | begining of OnTick()
02/06/2015 01:08:00.000 | begining of OnTick()
02/06/2015 01:09:00.000 | begining of OnTick()
02/06/2015 01:10:00.000 | begining of OnTick()
02/06/2015 01:11:00.000 | begining of OnTick()
02/06/2015 01:12:00.000 | begining of OnTick()
02/06/2015 01:13:00.000 | begining of OnTick()
02/06/2015 01:14:00.000 | begining of OnTick()
02/06/2015 01:15:00.000 | begining of OnTick()
02/06/2015 01:16:00.000 | begining of OnTick()
02/06/2015 01:17:00.000 | begining of OnTick()
02/06/2015 01:18:00.000 | begining of OnTick()
02/06/2015 01:19:00.000 | begining of OnTick()
02/06/2015 01:20:00.000 | begining of OnTick()
02/06/2015 01:21:00.000 | begining of OnTick()
02/06/2015 01:22:00.000 | begining of OnTick()
02/06/2015 01:23:00.000 | begining of OnTick()
02/06/2015 01:24:00.000 | begining of OnTick()
02/06/2015 01:25:00.000 | begining of OnTick()
02/06/2015 01:26:00.000 | begining of OnTick()
02/06/2015 01:27:00.000 | begining of OnTick()
02/06/2015 01:28:00.000 | begining of OnTick()
02/06/2015 01:29:00.000 | begining of OnTick()
02/06/2015 01:30:00.000 | begining of OnTick()
02/06/2015 01:31:00.000 | begining of OnTick()
02/06/2015 01:32:00.000 | begining of OnTick()
02/06/2015 01:33:00.000 | begining of OnTick()
02/06/2015 01:34:00.000 | begining of OnTick()
02/06/2015 01:35:00.000 | begining of OnTick()
02/06/2015 01:36:00.000 | begining of OnTick()
02/06/2015 01:37:00.000 | begining of OnTick()
02/06/2015 01:38:00.000 | begining of OnTick()
02/06/2015 01:39:00.000 | begining of OnTick()
02/06/2015 01:40:00.000 | begining of OnTick()
02/06/2015 01:41:00.000 | begining of OnTick()
02/06/2015 01:42:00.000 | begining of OnTick()
02/06/2015 01:43:00.000 | begining of OnTick()
02/06/2015 01:44:00.000 | begining of OnTick()
02/06/2015 01:45:00.000 | begining of OnTick()
02/06/2015 01:46:00.000 | begining of OnTick()
02/06/2015 01:47:00.000 | begining of OnTick()
02/06/2015 01:48:00.000 | begining of OnTick()
02/06/2015 01:49:00.000 | begining of OnTick()
02/06/2015 01:50:00.000 | begining of OnTick()
02/06/2015 01:51:00.000 | begining of OnTick()
02/06/2015 01:52:00.000 | begining of OnTick()
02/06/2015 01:53:00.000 | begining of OnTick()
02/06/2015 01:54:00.000 | begining of OnTick()
02/06/2015 01:55:00.000 | begining of OnTick()
02/06/2015 01:56:00.000 | begining of OnTick()
02/06/2015 01:57:00.000 | begining of OnTick()
02/06/2015 01:58:00.000 | begining of OnTick()
02/06/2015 01:59:00.000 | begining of OnTick()
02/06/2015 02:00:00.000 | begining of OnTick()
02/06/2015 02:01:00.000 | begining of OnTick()
02/06/2015 02:02:00.000 | begining of OnTick()
02/06/2015 02:03:00.000 | begining of OnTick()
02/06/2015 02:04:00.000 | begining of OnTick()
02/06/2015 02:05:00.000 | begining of OnTick()
02/06/2015 02:06:00.000 | begining of OnTick()
02/06/2015 02:07:00.000 | begining of OnTick()
02/06/2015 02:08:00.000 | begining of OnTick()
02/06/2015 02:09:00.000 | begining of OnTick()
02/06/2015 02:10:00.000 | begining of OnTick()
02/06/2015 02:11:00.000 | begining of OnTick()
02/06/2015 02:12:00.000 | begining of OnTick()
02/06/2015 02:13:00.000 | begining of OnTick()
02/06/2015 02:14:00.000 | begining of OnTick()
02/06/2015 02:15:00.000 | begining of OnTick()
02/06/2015 02:16:00.000 | begining of OnTick()
02/06/2015 02:16:00.000 | Closing position PID1
02/06/2015 02:16:00.000 | → Closing position PID1 SUCCEEDED, Position PID1
02/06/2015 02:17:00.000 | begining of OnTick()
02/06/2015 02:17:00.000 | Executing Market Order to Buy 1k GBPJPY
02/06/2015 02:17:00.000 | → Executing Market Order to Buy 1k GBPJPY SUCCEEDED, Position PID2
02/06/2015 02:18:00.000 | begining of OnTick()
02/06/2015 02:19:00.000 | begining of OnTick()
02/06/2015 02:20:00.000 | begining of OnTick()
02/06/2015 02:21:00.000 | begining of OnTick()
02/06/2015 02:21:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:21:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID3
02/06/2015 02:21:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:21:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID4
02/06/2015 02:22:00.000 | begining of OnTick()
02/06/2015 02:23:00.000 | begining of OnTick()
02/06/2015 02:24:00.000 | begining of OnTick()
02/06/2015 02:25:00.000 | begining of OnTick()
02/06/2015 02:26:00.000 | begining of OnTick()
02/06/2015 02:27:00.000 | begining of OnTick()
02/06/2015 02:28:00.000 | begining of OnTick()
02/06/2015 02:28:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:28:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID5
02/06/2015 02:28:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:28:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID6
02/06/2015 02:29:00.000 | begining of OnTick()
02/06/2015 02:30:00.000 | begining of OnTick()
02/06/2015 02:31:00.000 | begining of OnTick()
02/06/2015 02:32:00.000 | begining of OnTick()
02/06/2015 02:33:00.000 | begining of OnTick()
02/06/2015 02:33:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:33:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID7
02/06/2015 02:33:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:33:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID8
02/06/2015 02:34:00.000 | begining of OnTick()
02/06/2015 02:35:00.000 | begining of OnTick()
02/06/2015 02:35:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:35:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID9
02/06/2015 02:35:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:35:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID10
02/06/2015 02:36:00.000 | begining of OnTick()
02/06/2015 02:36:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:36:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID11
02/06/2015 02:36:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:36:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID12
02/06/2015 02:37:00.000 | begining of OnTick()
02/06/2015 02:37:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:37:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID13
02/06/2015 02:37:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:37:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID14
02/06/2015 02:38:00.000 | begining of OnTick()
02/06/2015 02:38:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:38:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID15
02/06/2015 02:38:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:38:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID16
02/06/2015 02:39:00.000 | begining of OnTick()
02/06/2015 02:39:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:39:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID17
02/06/2015 02:39:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:39:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID18
02/06/2015 02:40:00.000 | begining of OnTick()
02/06/2015 02:40:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:40:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID19
02/06/2015 02:40:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:40:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID20
02/06/2015 02:41:00.000 | begining of OnTick()
02/06/2015 02:41:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:41:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID21
02/06/2015 02:41:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:41:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID22
02/06/2015 02:42:00.000 | begining of OnTick()
02/06/2015 02:42:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:42:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID23
02/06/2015 02:42:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:42:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID24
02/06/2015 02:43:00.000 | begining of OnTick()
02/06/2015 02:43:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:43:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID25
02/06/2015 02:43:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:43:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID26
02/06/2015 02:44:00.000 | begining of OnTick()
02/06/2015 02:44:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:44:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID27
02/06/2015 02:44:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:44:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID28
02/06/2015 02:45:00.000 | begining of OnTick()
02/06/2015 02:45:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:45:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID29
02/06/2015 02:45:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:45:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID30
02/06/2015 02:46:00.000 | begining of OnTick()
02/06/2015 02:46:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:46:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID31
02/06/2015 02:46:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:46:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID32
02/06/2015 02:47:00.000 | begining of OnTick()
02/06/2015 02:47:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:47:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID33
02/06/2015 02:47:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:47:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID34
02/06/2015 02:48:00.000 | begining of OnTick()
02/06/2015 02:48:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:48:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID35
02/06/2015 02:48:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:48:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID36
02/06/2015 02:49:00.000 | begining of OnTick()
02/06/2015 02:49:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:49:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID37
02/06/2015 02:49:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:49:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID38
02/06/2015 02:50:00.000 | begining of OnTick()
02/06/2015 02:50:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:50:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID39
02/06/2015 02:50:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:50:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID40
02/06/2015 02:51:00.000 | begining of OnTick()
02/06/2015 02:51:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:51:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID41
02/06/2015 02:51:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:51:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID42
02/06/2015 02:52:00.000 | begining of OnTick()
02/06/2015 02:52:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:52:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID43
02/06/2015 02:52:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:52:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID44
02/06/2015 02:53:00.000 | begining of OnTick()
02/06/2015 02:53:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:53:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID45
02/06/2015 02:53:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:53:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID46
02/06/2015 02:54:00.000 | begining of OnTick()
02/06/2015 02:54:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:54:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID47
02/06/2015 02:54:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:54:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID48
02/06/2015 02:55:00.000 | begining of OnTick()
02/06/2015 02:56:00.000 | begining of OnTick()
02/06/2015 02:56:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:56:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID49
02/06/2015 02:56:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:56:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID50
02/06/2015 02:57:00.000 | begining of OnTick()
02/06/2015 02:57:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:57:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID51
02/06/2015 02:57:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:57:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID52
02/06/2015 02:58:00.000 | begining of OnTick()
02/06/2015 02:58:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:58:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID53
02/06/2015 02:58:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:58:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID54
02/06/2015 02:59:00.000 | begining of OnTick()
02/06/2015 02:59:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:59:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID55
02/06/2015 02:59:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 02:59:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID56
02/06/2015 03:00:00.000 | begining of OnTick()
02/06/2015 03:00:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:00:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID57
02/06/2015 03:00:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:00:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID58
02/06/2015 03:01:00.000 | begining of OnTick()
02/06/2015 03:01:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:01:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID59
02/06/2015 03:01:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:01:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID60
02/06/2015 03:02:00.000 | begining of OnTick()
02/06/2015 03:02:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:02:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID61
02/06/2015 03:02:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:02:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID62
02/06/2015 03:03:00.000 | begining of OnTick()
02/06/2015 03:03:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:03:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID63
02/06/2015 03:03:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:03:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID64
02/06/2015 03:04:00.000 | begining of OnTick()
02/06/2015 03:04:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:04:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID65
02/06/2015 03:04:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:04:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID66
02/06/2015 03:05:00.000 | begining of OnTick()
02/06/2015 03:05:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:05:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID67
02/06/2015 03:05:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:05:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID68
02/06/2015 03:06:00.000 | begining of OnTick()
02/06/2015 03:06:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:06:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID69
02/06/2015 03:06:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:06:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID70
02/06/2015 03:07:00.000 | begining of OnTick()
02/06/2015 03:07:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:07:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID71
02/06/2015 03:07:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:07:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID72
02/06/2015 03:08:00.000 | begining of OnTick()
02/06/2015 03:08:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:08:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID73
02/06/2015 03:08:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:08:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID74
02/06/2015 03:09:00.000 | begining of OnTick()
02/06/2015 03:09:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:09:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID75
02/06/2015 03:09:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:09:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID76
02/06/2015 03:10:00.000 | begining of OnTick()
02/06/2015 03:10:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:10:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID77
02/06/2015 03:10:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:10:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID78
02/06/2015 03:11:00.000 | begining of OnTick()
02/06/2015 03:11:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:11:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID79
02/06/2015 03:11:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:11:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID80
02/06/2015 03:12:00.000 | begining of OnTick()
02/06/2015 03:12:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:12:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID81
02/06/2015 03:12:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:12:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID82
02/06/2015 03:13:00.000 | begining of OnTick()
02/06/2015 03:13:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:13:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID83
02/06/2015 03:13:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:13:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID84
02/06/2015 03:14:00.000 | begining of OnTick()
02/06/2015 03:14:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:14:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID85
02/06/2015 03:14:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:14:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID86
02/06/2015 03:15:00.000 | begining of OnTick()
02/06/2015 03:15:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:15:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID87
02/06/2015 03:15:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:15:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID88
02/06/2015 03:16:00.000 | begining of OnTick()
02/06/2015 03:16:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:16:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID89
02/06/2015 03:16:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:16:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID90
02/06/2015 03:17:00.000 | begining of OnTick()
02/06/2015 03:17:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:17:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID91
02/06/2015 03:17:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:17:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID92
02/06/2015 03:18:00.000 | begining of OnTick()
02/06/2015 03:18:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:18:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID93
02/06/2015 03:18:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:18:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID94
02/06/2015 03:19:00.000 | begining of OnTick()
02/06/2015 03:19:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:19:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID95
02/06/2015 03:19:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:19:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID96
02/06/2015 03:20:00.000 | begining of OnTick()
02/06/2015 03:20:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:20:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID97
02/06/2015 03:20:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:20:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID98
02/06/2015 03:21:00.000 | begining of OnTick()
02/06/2015 03:21:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:21:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID99
02/06/2015 03:21:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:21:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID100
02/06/2015 03:22:00.000 | begining of OnTick()
02/06/2015 03:22:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:22:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID101
02/06/2015 03:22:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:22:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID102
02/06/2015 03:23:00.000 | begining of OnTick()
02/06/2015 03:23:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:23:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID103
02/06/2015 03:23:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:23:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID104
02/06/2015 03:24:00.000 | begining of OnTick()
02/06/2015 03:24:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:24:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID105
02/06/2015 03:24:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:24:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID106
02/06/2015 03:25:00.000 | begining of OnTick()
02/06/2015 03:25:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:25:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID107
02/06/2015 03:25:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:25:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID108
02/06/2015 03:26:00.000 | begining of OnTick()
02/06/2015 03:26:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:26:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID109
02/06/2015 03:26:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:26:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID110
02/06/2015 03:27:00.000 | begining of OnTick()
02/06/2015 03:28:00.000 | begining of OnTick()
02/06/2015 03:28:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:28:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID111
02/06/2015 03:28:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:28:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID112
02/06/2015 03:29:00.000 | begining of OnTick()
02/06/2015 03:29:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:29:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID113
02/06/2015 03:29:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:29:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID114
02/06/2015 03:30:00.000 | begining of OnTick()
02/06/2015 03:30:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:30:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID115
02/06/2015 03:30:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:30:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID116
02/06/2015 03:31:00.000 | begining of OnTick()
02/06/2015 03:31:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:31:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID117
02/06/2015 03:31:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:31:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID118
02/06/2015 03:32:00.000 | begining of OnTick()
02/06/2015 03:32:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:32:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID119
02/06/2015 03:32:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:32:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID120
02/06/2015 03:33:00.000 | begining of OnTick()
02/06/2015 03:33:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:33:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID121
02/06/2015 03:33:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:33:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID122
02/06/2015 03:34:00.000 | begining of OnTick()
02/06/2015 03:34:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:34:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID123
02/06/2015 03:34:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:34:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID124
02/06/2015 03:35:00.000 | begining of OnTick()
02/06/2015 03:35:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:35:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID125
02/06/2015 03:35:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:35:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID126
02/06/2015 03:36:00.000 | begining of OnTick()
02/06/2015 03:36:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:36:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID127
02/06/2015 03:36:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:36:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID128
02/06/2015 03:37:00.000 | begining of OnTick()
02/06/2015 03:37:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:37:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID129
02/06/2015 03:37:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:37:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID130
02/06/2015 03:38:00.000 | begining of OnTick()
02/06/2015 03:38:00.000 | Executing Market Order to Sell 1k GBPJPY
02/06/2015 03:38:00.000 | → Executing Market Order to Sell 1k GBPJPY SUCCEEDED, Position PID131
02/06/2015 03:38:00.000 | before close all
02/06/2015 03:38:00.000 | 2, Buy, 1000, Roni Trend cBot, 1st
02/06/2015 03:38:00.000 | -----------------------------------------
02/06/2015 03:38:00.000 | at end of PrintAllPositions()
02/06/2015 03:38:00.000 | hello from closeAll...
02/06/2015 03:38:00.000 | Closing position PID2
02/06/2015 03:38:00.000 | → Closing position PID2 SUCCEEDED, Position PID2
02/06/2015 03:38:00.000 | TradeResult (Success, Position: PID2)
02/06/2015 03:38:00.000 | after close all
02/06/2015 03:38:00.000 | at end of PrintAllPositions()
02/06/2015 03:38:00.000 | Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array.
02/06/2015 03:38:00.000 | Backtesting was stopped
@aharonzbaida
aharonzbaida
20 Jul 2015, 09:23
To All;
I modified the code and am no longer getting the original exception, though I still don't understand the cause. I am now getting a null reference exception that crashes on backtest. When I tried using the debug feature of Visual Studio, I got a message that since the output type of the project is a class (what cAlgo gets from VS), I would need to add a start project to the solution. So I added a Console project for the purpose of using VS debugger to the cBot Solution in VS. I added a reference to the console project pointing at the cBot project. But, VS does not 'see' it and gives an error in the using statement:
Error 1 The type or namespace name 'Roni_cBot' could not be found (are you missing a using directive or an assembly reference?) C:\Users\A\Documents\cAlgo\Sources\Robots\Roni_cBot\ForDebug\Program.cs 6 7 ForDebug
Should this go in a separate thread?, or can someone suggest a proper way to use the VS debugger for my cBots? Thank you please.
-Roni
@aharonzbaida
aharonzbaida
20 Jul 2015, 09:26
P.S.
the new cBot code is:
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
// -------------------------------------------------------------------------------------------------
// Modified cBot Roni renamed to Roni_cBot
// plan of action: 1st build LRSBB_ind as basis for this cBot
// pingpong adverse exit
// --------------------------------------------------------------
// 13 July looks like close all doesn't work or never reaches, see log for print statements - problem that backtester didnt get result of ClosePositionAsynch
// 14 July : 02/06/2015 10:04:00.000 | Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array.
// 15 July could not yet debug - sent request to ctdn forum
// 20 July changed if then statements and stopped getting exception - still dont know exact cause
// also renamed to Roni_cBot
// made changes: all exist even for first leg is by PingPongExit(), now getting null ref exception, need to add start project to sol'n in order to debug
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class Roni_cBot : Robot
{
[Parameter("Initial Target Pips", DefaultValue = 15)]
public int initTargetPips { get; set; }
[Parameter("Symetric Half Zone Pips", DefaultValue = 15)]
public int halfZone { get; set; }
[Parameter("Symetric Targets Beyond Zone Pips", DefaultValue = 15)]
public int targetBeyondZone { get; set; }
//[Parameter()]
//public DataSeries SourceSeries { get; set; }
[Parameter(DefaultValue = 1000, MinValue = 1000)]
public int Volume { get; set; }
//private MovingAverage slowMa;
//private MovingAverage fastMa;
private const string label = "Roni_cBot";
//private bool pingPongActivated = false;
private Position[] allPositions;
//array of positions
//Position[] longPositions;
//to hold long positions
//Position[] shortPositions;
//to hold short positions
protected override void OnStart()
{
//fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MovingAverageType.Simple);
//slowMa = Indicators.MovingAverage(SourceSeries, SlowMAPeriods, MovingAverageType.Simple);
//UpdatePositionsArray();
////PrintAllPositions(allPositions);
}
protected override void OnTick()
{
if (allPositions.Length == 0)
{
//if no open position, seek entry
//pingPongActivated = false;
//if no positions yet, then pingpong exit is off
CheckForEntry();
//if only one position
}
else if (allPositions.Length > 0)
{
//pingPongActivated = true;
PingPongExit();
}
}
//OnTick()
private void PingPongExit()
{
int numberOfPositions = allPositions.Length;
//is first leg always first in the array?
if (numberOfPositions > 0 && allPositions[0].Comment != "1st")
{
Print("Position ID {0} is first in allpositions array but not first leg!", allPositions[0].Id);
}
//calculate zone and targets based on initial entry
double lowerZoneBoundry = allPositions[0].EntryPrice - halfZone * Symbol.PipSize;
double upperZoneBoundry = allPositions[0].EntryPrice + halfZone * Symbol.PipSize;
double upperTarget = upperZoneBoundry + targetBeyondZone * Symbol.PipSize;
double lowerTarget = lowerZoneBoundry - targetBeyondZone * Symbol.PipSize;
//if 1st leg reached initial target, close it
if (numberOfPositions == 1 && allPositions[0].Pips >= initTargetPips)
{
Print("hello from close of 1st leg section of pingpong");
CloseAllPositionsThisBotAndSymbol();
}
//if price moves beyond upper zone boundry - rebalance for b/e or better on the upper target (ask price)
//else if price moves beyond lower zone boundry - rebalance for b/e or better on the lower target (bid)
if (Symbol.Ask >= upperZoneBoundry)
{
Print("hello from above upperZoneBoundry of pingpong");
//re-balace positions to break-even or better on upperTarget
long vol = GetVolumeToBrkEvn(GetPLatTarget(upperTarget), targetBeyondZone);
Print("vol returned = {0}", vol);
var tr = ExecuteMarketOrder(TradeType.Buy, Symbol, vol);
//Print("tradeResult ={0}", tr.ToString());
}
if (Symbol.Bid <= lowerZoneBoundry)
{
Print("hello from below lowerZoneBoundry of pingpong");
//re-balace positions to break-even or better on upperTarget
long vol = GetVolumeToBrkEvn(GetPLatTarget(lowerTarget), targetBeyondZone);
Print("vol returned = {0}", vol);
var tr = ExecuteMarketOrder(TradeType.Sell, Symbol, vol);
//Print("tradeResult ={0}", tr.ToString());
}
//update positions array
UpdatePositionsArray();
//is last position at target?
if (Symbol.Bid >= upperTarget || Symbol.Ask <= lowerTarget)
{
Print("before close all");
PrintAllPositions(allPositions);
CloseAllPositionsThisBotAndSymbol();
Print("after close all");
PrintAllPositions(allPositions);
}
return;
}
//PingPongExit()
private void CloseAllPositionsThisBotAndSymbol()
{
UpdatePositionsArray();
foreach (var pos in allPositions)
{
Print("hello from closeAll...");
TradeResult tr = ClosePosition(pos);
//ClosePositionAsync(pos);
Print(tr.ToString());
}
UpdatePositionsArray();
}
//CloseAllPositionsThisBotAndSymbol()
private double GetPLatTarget(double priceTarget)
{
//this method calculates sum of profit loss from all open positions including commissions at target price
double plSum = 0.0;
foreach (var pos in allPositions)
{
double pips2target = pos.TradeType == TradeType.Buy ? (priceTarget - pos.EntryPrice) / Symbol.PipSize : (pos.EntryPrice - priceTarget) / Symbol.PipSize;
double posPL = pips2target * pos.Volume * Symbol.PipValue + pos.Commissions + pos.Swap;
//are commission and swap values reported (-) vlaues?
plSum += posPL;
////string s = "GetPLatTarget(): \n" + "pips2target= " + pips2target.ToString() + "\n" + "allPositions.Length = " + allPositions.Length.ToString() + "\n" + "Position: ID:" + pos.Id.ToString() + ", " + pos.TradeType.ToString() + ", vol:" + pos.Volume.ToString() + "\n" + "Pos. Com.: " + pos.Commissions + "\n" + "Pip value: " + Symbol.PipValue + "\n" + "Pos. P/L at Target: " + posPL.ToString() + "\n" + "Pos's P/L Sum: " + plSum.ToString();
//Print(s);
}
return plSum;
}
//GetPLatTarget()
private long GetVolumeToBrkEvn(double pl, int pipsToTarget)
{
//this method return required volume to break even or better at price target including commissions (excluding swap)
//and considering mininimum trade volume increments
//where pl is P/L to overcome, and
//pipsToTarget is number of pips from zone extereme to exit target
double temp = pl / (pipsToTarget * Symbol.PipValue);
double t2 = temp / 1000;
//get lots of 1000
double t3 = pl + t2 * 0.18;
//commission $0.09 each direction per 1000 assumed
temp = t3 / (pipsToTarget * Symbol.PipValue);
//string s = "pl = " + pl.ToString() + "\n" + "pipsToTarget = " + pipsToTarget.ToString() + "\n" + "temp/1000=volume = " + (temp / 1000).ToString() + "\n" + "Symbol.NormalizeVolume(temp/1000, RoundingMode.Up) = " + Symbol.NormalizeVolume(temp / 1000, RoundingMode.Up).ToString();
//Print("hello from GetVolumeToBrkEvn \n{0}", s);
return Symbol.NormalizeVolume(temp, RoundingMode.Up);
}
//GetVolumeToBrkEvn
private void CheckForEntry()
{
//enter random
Random r = new Random((int)DateTime.Now.Ticks & 0xffff);
int dir = r.Next(-2, 2);
if (dir >= 0)
{
ExecuteMarketOrder(TradeType.Buy, Symbol, 1000, label, null, null, null, "1st");
}
else if (dir < 0)
{
ExecuteMarketOrder(TradeType.Sell, Symbol, 1000, label, null, null, null, "1st");
}
else
return;
}
//CheckForEntry()
private void UpdatePositionsArray()
{
allPositions = Positions.FindAll(label, Symbol);
// PrintAllPositions(allPositions);
}
//UpdatePositionsArray()
private void PrintAllPositions(Position[] ap)
{
//Print("ap.len=",ap.Length);
//if (ap.Length>0)
//{
foreach (var pos in ap)
{
Print(pos.Id, ", ", pos.TradeType, ", ", pos.Volume, ", ", pos.Label, ", ", pos.Comment);
Print("-----------------------------------------");
}
Print("at end of PrintAllPositions()");
//}
}
//PrintAllPositions()
protected override void OnStop()
{
// Put your deinitialization logic here
}
}
//class Roni_cBot
}
//namespace cAlgo
@aharonzbaida
Spotware
21 Jul 2015, 14:04
( Updated at: 21 Dec 2023, 09:20 )
Dear Trader,
Regarding the code that you also send to troubleshooting@spotware.com.
In this code snippet you have some conditions to call the method PingPongExit() in the OnTick()
When you backtest, your cBot opens the position and in a certain period through the first PingPongExit(); shown in the picture below.
Within the PingPongExit() method you initialize variables based on the first position. Then you do some calculations and then you close all positions using the CloseAllPositionsThisBotAndSymbol() method if your if statement is valid, which is in your case. This method closes all positions and then it updates the “allPositions” array. So allPositions array contains null positions.
Then your code reaches to the third PingPongExit() method.
You try to access the allPositions[0], which is null.That's why you get the exception:
Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array.
Please note that we do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.
@Spotware
aharonzbaida
21 Jul 2015, 15:09
( Updated at: 21 Dec 2023, 09:20 )
RE:
Thank you for taking the time to look into this. Regarding using the debugger in VS for debugging cBots, is there any reference on doings so?
Thank you again, you attention is appreciated.
-Roni
Spotware said:
Dear Trader,
Regarding the code that you also send to troubleshooting@spotware.com.
In this code snippet you have some conditions to call the method PingPongExit() in the OnTick()
When you backtest, your cBot opens the position and in a certain period through the first PingPongExit(); shown in the picture below.
Within the PingPongExit() method you initialize variables based on the first position. Then you do some calculations and then you close all positions using the CloseAllPositionsThisBotAndSymbol() method if your if statement is valid, which is in your case. This method closes all positions and then it updates the “allPositions” array. So allPositions array contains null positions.
Then your code reaches to the third PingPongExit() method.
You try to access the allPositions[0], which is null.That's why you get the exception:
Crashed in OnTick with IndexOutOfRangeException: Index was outside the bounds of the array.Please note that we do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.
@aharonzbaida
Spotware
21 Jul 2015, 15:54
Dear Trader,
Please take a look at the following link: http://help.spotware.com/calgo/visual-studio/debug-cbots
@Spotware
Spotware
15 Jul 2015, 11:39
Dear Trader,
Could you please send us your code at troubleshooting@spotware.com. We will use it only for troubleshooting purposes.
@Spotware