Profile Picture

Live System does not place order

Posted By kd7038 10 Years Ago
Message
Posted Friday March 23 2007
I tried to run the following trading system in the live system:

using System;
using System.Drawing;
using RightEdge.Common;
using System.Collections.Generic;
using RightEdge.Indicators;

public class SystemMain : SystemBase
{
public override void Startup()
{
// Set system wide options here

// Here is your profit target value
this.SystemData.ProfitTarget = 0.04;
// Here is your time out exit value.
// Change this to 0 for no time-out
this.SystemData.BarCountExit = 7;

// Set up indicators here
Indicators["BBL"].CreateIndicator(new BollingerBandLower(14, 1.9));
Indicators["BBL"].SetInputs(BarElement.Close);
Indicators["BBL"].SeriesColor = Color.Red;
Indicators["BBL"].AddToCharts();
}

public override void NewSymbolBar(Symbol symbol, BarData bar)
{
ISeries bbLower = Indicators["BBL"][symbol];
double targetPrice = bbLower[bbLower.Count - 1];
      string id = string.Empty;
      string des = string.Empty;
//this.SystemData.OpenPosition(symbol, PositionType.Long, OrderType.Limit ,out id targetPrice);
      this.PositionManager.OpenPosition(symbol, PositionType.Long, OrderType.Limit, targetPrice, 0, des, id );
}
}

I use IB Paper Trader. Live System Bars = 20

It works fine in simulation mode.

Thanks
Posted Friday March 23 2007
I don't see anything wrong with your trading system.  I have made a lot of improvements and bug fixes to the live system window and the Interactive Broker's plugin this week.  So I think your system will probably work when we release the next refresh (which we expect to do next week).  If the market was still open I would try it out and see if it worked, but that will have to wait till Monday.

Thanks,
Daniel

Posted Monday March 26 2007
I have also tested the code with the RightEdge Paper Trader. And I have insert following code before the order placement:

MessageBox.Show("Buy " + symbol.Name);

The Trading System execute the order placement command but I have no entry in the "Pending Orders".

For me it seems it have nothing to do with the TWS plugin, since it also don't work with the RightEdge Paper Trader.

Any Ideas?
Posted Monday March 26 2007
I also fixed a lot of issues with the live data window.  So, I am optimistic that this is a problem that will be fixed in the next release.

Thanks,
Daniel

Posted Tuesday March 27 2007
I ran your system today, and uncovered some more bugs, which I fixed.  I recommend changing the "shares" argument to the open position function.  This is really the size of your order, whether it be in shares, or contracts, or whatever.  If you leave it at zero, it will automatically size your position based on your project settings.  The default is to allocate 20% of your buying power towards a position.  The IB paper trader gives you $1 million in buying power, so 20% is probably more than you want.

Also, make sure that you have the tick size and contract size set correctly in the symbol information (right click on the symbol in the watch list and select symbol information).  Otherwise, IB may reject your order because it does not conform to the minimum price variaton.  Right now we don't display this message for you, so you might see the order appear and disappear without knowing why.  I have added bug 897 to add a message when the order is rejected telling you whay.

Thanks,
Daniel

Posted Thursday March 29 2007
I ran the system with watchlist only considering stocks. The fields tick size and contract size are grayed... I can not change it. Is this correct?

Do plan to implement a debugging function trading system developers?

Thanks
KAI
Posted Thursday March 29 2007
kd7038 (3/29/2007)
I ran the system with watchlist only considering stocks. The fields tick size and contract size are grayed... I can not change it. Is this correct?

Do plan to implement a debugging function trading system developers?

Thanks
KAI

For some reason I thought you were trading futures.  When trading stocks you should not have to set these values (and indeed, you can't).

You can debug your trading system using Visual Studio or SharpDevelop.  See these threads for more information:

http://www.rightedgesystems.com/forums/Topic1478-12-1.aspx
http://www.rightedgesystems.com/forums/Topic921-7-1.aspx

Thanks,
Daniel

Posted Wednesday April 11 2007
Hi,

I have tested it again with Build 293 and some other trading systems. I still have the problem, that the system tried to place orders but these orders were not executed. I can't see this orders in the folder "Pending Orders" or in the TWS.

Can you help me?

Thanks
Kai
Posted Wednesday June 06 2007
have the bugs fixed?

kd7038 (4/11/2007)
Hi,

I have tested it again with Build 293 and some other trading systems. I still have the problem, that the system tried to place orders but these orders were not executed. I can't see this orders in the folder "Pending Orders" or in the TWS.

Can you help me?

Thanks
Kai
Posted Wednesday June 06 2007
TickJob (6/6/2007)
have the bugs fixed?

kd7038 (4/11/2007)
Hi,

I have tested it again with Build 293 and some other trading systems. I still have the problem, that the system tried to place orders but these orders were not executed. I can't see this orders in the folder "Pending Orders" or in the TWS.

Can you help me?

Thanks
Kai


We fixed a lot of bugs that could happen when running live systems. So I think it is likely that it is fixed in the latest beta. Please let us know if it is not.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems