Profile Picture

Order timing out throughs in an error before fill in live trading

Posted By eeikel 9 Years Ago

Order timing out throughs in an error before fill in live trading

Message
Posted Thursday January 17 2008
Something is wrong but what?

Running in live strategy mode after the system executing an openingsorder on signals this error is made.In the live system console the order is set as pending order.

Broker = paperbroker connected through TWS from IB.

Instruments on 1 min charts

An exception of type System.AppDomainUnloadedException was thrown.
Attempted to access an unloaded AppDomain.
   at RightEdge.Shared.CallbackStub.DoCallback()
   at RightEdge.Shared.MainDomainStub.<>c__DisplayClass1.<Post>b__0()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

second

Unable to cancel order that timed out:
   at RightEdge.Common.PositionManager.ProcessTimeouts(PositionData pos, NewBarInfo info, Boolean& changed)
   at RightEdge.Common.PositionManager.SimNewBar(NewBarInfo info)
   at RightEdge.Common.BaseSystemHistory.SimNewBar(NewBarInfo info)
   at RightEdge.Common.SystemData.NewBar(NewBarInfo info)
   at RightEdge.SystemWrapper.NewBar(Dictionary`2 bars)
   at RightEdge.SystemWrapper.NewBar(Dictionary`2 bars)
   at RightEdge.TradingModuleWrapper.NewBar(Dictionary`2 bars)
   at RightEdge.LiveSystemwindow.x2e01f099ee7feedb(Dictionary`2 xd3a52115666f4605)


Edited: Thursday January 17 2008 by eeikel
Posted Friday January 18 2008
Solved the problem,

changed PositionManager.OpenPosition(symbol,PositionType.Long,OrderType.Limit,bar.High);

to

PositionOrder newPos = new PositionOrder();

newPos.OrderSymbol = symbol;

newPos.PositionType = PositionType.Long;

newPos.OrderType = OrderType.Limit;

newPos.LimitPrice = bar.High;

newPos.BarsValid = 3;

PositionManager.OpenPosition(newPos);

The barsValid option set to 3 solves it to wait 3 bars before cancelling the order Smile

Now the IB broker thing to get the generated orders executed in IB TWS.



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems