OrderMan - Ordering interface for NOW + Amibroker

boarders

Well-Known Member
#31
this is what I am getting when I right clicked in tray and opened:

Script lines most recently executed (oldest first). Press [F5] to refresh. The seconds elapsed between a line and the one after it is in parentheses to the right (if not 0). The bottommost line's elapsed time is the number of seconds since it executed.

---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Orderbook.ahk
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
319: targetObject[key] := index
320: Break
323: }
314: Loop,targetHeaders.MaxIndex()
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
319: targetObject[key] := index
320: Break
323: }
314: Loop,targetHeaders.MaxIndex()
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
322: }
315: columnText := targetHeaders[A_Index]
316: key := targetKeys[A_Index]
318: if ( headertext == columnText )
319: targetObject[key] := index
320: Break
323: }
324: Loop,targetHeaders.MaxIndex()
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
325: columnText := targetHeaders[A_Index]
326: key := targetKeys[A_Index]
328: this._checkEmpty( targetObject[key], columnText, listIdentifier )
337: if ( value == "" )
342: }
329: }
330: }
302: columnsRead := true
303: }
034: this.readOpenOrders()
055: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
057: this.OpenOrders := {}
058: this.OpenOrders.size := 0
059: index := this._openOrdersColumnIndex
061: ControlGet,openOrdersRaw,List,,SysListView321,%TITLE_ORDER_BOOK%
063: Loop,Parse,openOrdersRaw,

096: }
035: this.readCompletedOrders()
103: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
105: this.CompletedOrders := {}
106: this.CompletedOrders.size := 0
107: index := this._completedOrdersColumnIndex
109: ControlGet,completedOrdersRaw,List,,SysListView322,%TITLE_ORDER_BOOK%
111: Loop,Parse,completedOrdersRaw,

146: }
036: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderMan.ahk
070: createGUI()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
021: SetFormat,FloatFast,0.2
023: isABPick := false
025: Gui,1:New,+AlwaysOnTop +Resize,OrderMan
027: Gui,1:Add,ListBox,vDirection gonDirectionChange h30 w20 Choose1,B|S (0.03)
028: Gui,1:Add,Edit,vQty w30
030: Gui,1:Add,Text,vEntryText ym,Entry
031: Gui,1:Add,Text,vAddText xp+0 yp+0,Add (0.03)
032: Gui,1:Add,Text,gstopClick,Stop
033: Gui,1:Add,Text,gTargetClick,Target
035: Gui,1:Add,Edit,vEntryPrice w55 ym gonEntryPriceChange
036: Gui,1:Add,Edit,vStopPrice w55 gonStopPriceChange
037: Gui,1:Add,Edit,vTargetPrice w55 gupdateCurrentResult
039: Gui,1:Add,Button,gonNew vBtnOrder xp-35 y+m,New (0.03)
040: Gui,1:Add,Button,gonUpdate vBtnUpdate xp+0 yp+0,Update
042: Gui,1:Add,Button,gopenLinkOrdersGUI vBtnLink x+5,Link
043: Gui,1:Add,Button,gonUnlink vBtnUnlink xp+0 yp+0,Unlink
045: Gui,1:Add,UpDown,vEntryUpDown gOnEntryUpDown Range0-1 -16 hp-2 x+0 ym
046: Gui,1:Add,UpDown,vStopUpDown gOnStopUpDown Range0-1 -16 hp (0.03)
047: Gui,1:Add,UpDown,vTargetUpDown gOnTargetUpDown Range0-1 -16 hp
049: Gui,1:Add,DropDownList,vEntryOrderType w45 Choose1 ym,LIM|SL|SLM|M (0.06)
051: Gui,1:Add,Text,vCurrentResult w45
052: Gui,1:Add,Text,vTargetResult w45
053: Gui,1:Add,Button,gonCancel vBtnCancel y+14,Cancel
054: Gui,1:Add,Button,gonAdd vBtnAdd xp+0 yp+0,Add (0.03)
056: Gui,1:Add,Text,ym vEntryStatus
057: Gui,1:Add,Text,vStopStatus
058: Gui,1:Add,Text,vTargetStatus
060: Gui,1:Add,StatusBar,gstatusBarClick
062: Gui,1:Show,AutoSize NoActivate %LastWindowPosition% (0.03)
064: setGUIValues(Qty, 0, 0, 0, "B", EntryOrderType)
329: setQty( inQty )
341: Qty := inQty
342: GuiControl,1:Text,Qty,%Qty%
343: }
330: setEntryPrice( inEntry, inEntry )
355: EntryPrice := inEntry
356: EntryPriceActual := inEntryPriceActual
357: GuiControl,1:Text,EntryPrice,%EntryPrice%
358: }
331: setStopPrice( inStop, inStop )
365: StopPrice := inStop
366: StopPriceActual := inStopPriceActual
367: GuiControl,1:Text,StopPrice,%StopPrice%
368: }
332: setDirection( inDirection )
380: Direction := inDirection
381: GuiControl,1:ChooseString,Direction,%Direction%
382: onDirectionChange()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\GuiActions.ahk
139: updateCurrentResult()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
179: Gui,1:Submit,NoHide
181: CurrentResult := Direction == "B" ? StopPrice-EntryPrice : EntryPrice-StopPrice
182: TargetResult := TargetPrice == 0 ? "" : (Direction == "B" ? TargetPrice-EntryPrice : EntryPrice-TargetPrice)
184: GuiControl,1:Text,CurrentResult,%CurrentResult%
185: GuiControl,1:Text,TargetResult,%TargetResult%
186: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\GuiActions.ahk
140: Gui,Color,Direction == "B" ? "33cc66" : "ff9933"
141: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
383: }
333: selectEntryOrderType( inEntryOrderType )
387: EntryOrderType := inEntryOrderType
388: GuiControl,1:ChooseString,EntryOrderType,%EntryOrderType%
389: }
334: setTargetPrice( inTargetPrice )
373: TargetPrice := inTarget
375: GuiControl,1:Text,TargetPrice,%TargetPrice%
376: }
336: updateStatus()
222: trade := contextObj.getCurrentTrade()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Context.ahk
023: Return,this.currentTrade
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
223: trade.reload()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
418: orderbookObj.read()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Orderbook.ahk
032: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
033: this._readColumnHeaders()
284: if ( columnsRead )
285: Return
034: this.readOpenOrders()
055: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
057: this.OpenOrders := {}
058: this.OpenOrders.size := 0
059: index := this._openOrdersColumnIndex
061: ControlGet,openOrdersRaw,List,,SysListView321,%TITLE_ORDER_BOOK%
063: Loop,Parse,openOrdersRaw,

096: }
035: this.readCompletedOrders()
103: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
105: this.CompletedOrders := {}
106: this.CompletedOrders.size := 0
107: index := this._completedOrdersColumnIndex
109: ControlGet,completedOrdersRaw,List,,SysListView322,%TITLE_ORDER_BOOK%
111: Loop,Parse,completedOrdersRaw,

146: }
036: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
419: if ( this.isNewEntryLinked() )
430: Return,IsObject( this.newEntryOrder ) && IsObject(this.newEntryOrder.getOrderDetails())
421: if ( this.isStopLinked() )
442: Return,IsObject( this.stopOrder ) && IsObject(this.stopOrder.getOrderDetails())
423: if ( this.isTargetLinked() )
446: Return,IsObject( this.targetOrder ) && IsObject(this.targetOrder.getOrderDetails())
425: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
225: entryOrderDetails := trade.newEntryOrder.getOrderDetails()
226: stopOrderDetails := trade.stopOrder.getOrderDetails()
227: targetOrderDetails := trade.targetOrder.getOrderDetails()
229: entryLinked := trade.isNewEntryLinked()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
430: Return,IsObject( this.newEntryOrder ) && IsObject(this.newEntryOrder.getOrderDetails())
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
230: stopLinked := trade.isStopLinked()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
442: Return,IsObject( this.stopOrder ) && IsObject(this.stopOrder.getOrderDetails())
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
231: anyLinked := entryLinked || stopLinked
232: targetLinked := trade.isTargetLinked()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
446: Return,IsObject( this.targetOrder ) && IsObject(this.targetOrder.getOrderDetails())
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
233: entryOpen := trade.isEntryOpen()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
466: Return,IsObject( this.newEntryOrder ) && this.newEntryOrder.isOpen()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
234: isStopPending := trade.isStopPending
235: stopOpen := trade.isStopOpen() || isStopPending
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
472: Return,IsObject( this.stopOrder ) && this.stopOrder.isOpen()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
236: isEntryClosed := trade.isEntryClosed()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
478: Return,IsObject( this.newEntryOrder ) && this.newEntryOrder.isClosed()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
237: isStopClosed := trade.isStopClosed()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Trade.ahk
484: Return,IsObject( this.stopOrder ) && this.stopOrder.isClosed()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
238: positionSize := trade.positionSize
239: openSize := entryLinked ? entryOrderDetails.totalQty : 0
240: isEntered := positionSize > 0
242: GuiControl,isEntered ? "1:Hide" : "1:Show",EntryText
243: GuiControl,isEntered ? "1:Show" : "1:Hide",AddText
245: GuiControl,anyLinked ? "1:Disable" : "1:Enable",Direction
246: GuiControl,anyLinked ? "1:Show" : "1:Hide",BtnUnlink
247: GuiControl,anyLinked ? "1:Hide" : "1:Show",BtnLink
248: GuiControl,anyLinked ? "1:Hide" : "1:Show",BtnOrder
250: GuiControl,entryOpen || stopOpen ? "1:Show" : "1:Hide",BtnUpdate
251: GuiControl,entryOpen ? "1:Show" : "1:Hide",BtnCancel (0.02)
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\GuiActions.ahk
146: if ( isABPick )
151: Gui,1:Submit,NoHide
153: EntryPriceActual := EntryPrice
154: updateCurrentResult()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
179: Gui,1:Submit,NoHide
181: CurrentResult := Direction == "B" ? StopPrice-EntryPrice : EntryPrice-StopPrice
182: TargetResult := TargetPrice == 0 ? "" : (Direction == "B" ? TargetPrice-EntryPrice : EntryPrice-TargetPrice)
184: GuiControl,1:Text,CurrentResult,%CurrentResult%
185: GuiControl,1:Text,TargetResult,%TargetResult%
186: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\GuiActions.ahk
155: }
160: if ( isABPick )
165: Gui,1:Submit,NoHide
167: StopPriceActual := StopPrice
168: updateCurrentResult()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
179: Gui,1:Submit,NoHide
181: CurrentResult := Direction == "B" ? StopPrice-EntryPrice : EntryPrice-StopPrice
182: TargetResult := TargetPrice == 0 ? "" : (Direction == "B" ? TargetPrice-EntryPrice : EntryPrice-TargetPrice)
184: GuiControl,1:Text,CurrentResult,%CurrentResult%
185: GuiControl,1:Text,TargetResult,%TargetResult%
186: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\GuiActions.ahk
169: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
179: Gui,1:Submit,NoHide
181: CurrentResult := Direction == "B" ? StopPrice-EntryPrice : EntryPrice-StopPrice
182: TargetResult := TargetPrice == 0 ? "" : (Direction == "B" ? TargetPrice-EntryPrice : EntryPrice-TargetPrice)
184: GuiControl,1:Text,CurrentResult,%CurrentResult%
185: GuiControl,1:Text,TargetResult,%TargetResult%
186: }
252: GuiControl,isEntered && !entryLinked ? "1:Show" : "1:Hide",BtnAdd
254: GuiControl,!entryLinked || entryOpen ? "1:Enable" : "1:Disable",EntryPrice
255: GuiControl,!stopLinked || stopOpen ? "1:Enable" : "1:Disable",StopPrice
257: status := ""
258: if ( entryLinked )
262: setOrderStatus( "EntryStatus", status )
298: if ( status == "" )
299: GuiControl,1:Text,%statusGuiId%
300: GuiControl,1:Move,%statusGuiId%,w1
301: Return
264: status := ""
265: if ( stopLinked )
269: if ( isStopPending )
273: setOrderStatus( "StopStatus", status )
298: if ( status == "" )
299: GuiControl,1:Text,%statusGuiId%
300: GuiControl,1:Move,%statusGuiId%,w1
301: Return
275: status := ""
276: if ( targetLinked )
280: if ( trade.targetOrder.getPrice() > 0 && entryOpen )
284: setOrderStatus( "TargetStatus", status )
298: if ( status == "" )
299: GuiControl,1:Text,%statusGuiId%
300: GuiControl,1:Move,%statusGuiId%,w1 (0.03)
301: Return
286: isTimerActive := (entryLinked || stopLinked) && ! (isEntryClosed && isStopClosed)
287: isTimerActive := isTimerActive ? toggleStatusTracker( "on" ) : toggleStatusTracker( "off" )
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderTracker.ahk
033: if ( on_off == "on" )
038: if ( on_off == "off" )
039: isTimerActive := false
040: SetTimer,orderStatusTracker,off
041: }
042: Return,isTimerActive
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Gui.ahk
288: timeStatus := isTimerActive ? "ON" : "OFF"
290: SB_SetText( "Timer: " . timeStatus . " Open Position: " . positionSize . ". Unfilled: " . openSize )
292: Gui,1:Show,AutoSize NA
293: }
337: }
066: initalizeListViewVars()
418: listViewFields := "Type|Scrip|Status|OrderType|Buy/Sell|Qty|Price|Trigger|Average|Order No|Time"
419: listViewOrderIDPosition := 10
420: listViewOrderStatusPosition := 3
421: listViewOrderTypePosition := 4
422: }
068: Return
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderMan.ahk
071: checkForOpenOrders()
080: trade := contextObj.getCurrentTrade()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Context.ahk
023: Return,this.currentTrade
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderMan.ahk
082: if ( orderbookObj.doOpenOrdersExist() )
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\Orderbook.ahk
166: this.readOpenOrders()
055: this.open()
041: IfWinExist,%TITLE_ORDER_BOOK%
042: Return
057: this.OpenOrders := {}
058: this.OpenOrders.size := 0
059: index := this._openOrdersColumnIndex
061: ControlGet,openOrdersRaw,List,,SysListView321,%TITLE_ORDER_BOOK%
063: Loop,Parse,openOrdersRaw,

096: }
167: Return,this.OpenOrders.size > 0
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderMan.ahk
092: }
073: installHotkeys()
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\AB.ahk
021: Hotkey,IfWinActive,ahk_class AmiBrokerMainFrameClass
023: if ( HKEntryPrice != "" && HKEntryPrice != "ERROR")
024: Hotkey,%HKEntryPrice%,getEntryPriceFromAB (0.03)
026: if ( HKStopPrice != "" && HKStopPrice != "ERROR")
027: Hotkey,%HKStopPrice%,getStopPriceFromAB
029: if ( HKTargetPrice != "" && HKTargetPrice != "ERROR")
030: Hotkey,%HKTargetPrice%,getTargetPriceFromAB
031: }
---- C:\VINOD\ninja and yusi\New folder (2)\OrderMan\OrderMan\OrderMan.ahk
075: Return (98.19)

Press [F5] to refresh.
 

boarders

Well-Known Member
#32
now there is progress.

i opened and from task manager maximized the orderman and then adjusted the window size, got the order placement window, although whenever i restart orderman, I have to repeat this.

now whenever I fire the order, it tries to place the order and then closes the order placement window (although in user settings I have selected not to close same in NEST).
during this process, I can see that it selects the correct exchange and scrip. then two error windows as follows: Please advise

 

TracerBullet

Well-Known Member
#33
Why GUI didnt show before?

1) 1st Error - Need to debug and check. In Order.ahk - Flow for new order is create() -> _submitOrder() -> _submitOrderCommon().
Check what is being set in _submitOrder(). You can submit same manually and compare.
2) _submitOrderCommon() has the conditional submit in "if( AutoSubmit ){}" block. Need to debug it - or debug line by line to check what line closes it.
3) Order not found error - yes it will fail if order is not created after submit. Click no. yes option is meant to allow me to verify and if its created then continue (This will happen if order creation takes long time for example)

Also note below - Just some general functionality info for all -
1) You can pick prices from AB using hotkeys ( configurable via ini). Prices can be picked from line. So put cursor over line and enter shortcut. If there is no line it will try to pick from tooltip. This should be doable in NinjaTrader too, will check it later
2) Order linking - Once a trade is created and we have an open position, the order nos are saved. So if you close and open OM, they will be linked automatically if position is still open. We can also manually link to an order using link button
3) Double clicking status bar will give linked order details
4) Double clicking Stop Text will set default stop size. Similarly target.
Look at ini for options
 
Last edited:

boarders

Well-Known Member
#34
there is no "Direction" field in the NEST order entry window: must press F1 for buy and F2 for Sell windows.
Also clicking B or S does not change the order submit window or place the order, when new is clicked instead throws error Could not open Buy/Sell window.. We have to manually press F1 or F2 so that the appropriate window is ready in which case it changes some fields and closes the order submit window and throws the error as in my earlier post



 
Last edited:

TracerBullet

Well-Known Member
#35
there is no "Direction" field in the NEST order entry window: must press F1 for buy and F2 for Sell windows.
Also clicking B or S does not change the order submit window or place the order, when new is clicked instead throws error Could not open Buy/Sell window.. We have to manually press F1 or F2 so that the appropriate window is ready in which case it changes some fields and closes the order submit window and throws the error as in my earlier post



It will be hard to diagnose without debugging, you have to get used to the code flow.

1) B/S does not trigger change. All fields must be set correctly before New order. Only buttons will trigger order change
2) Instead of F1/F2 i use menu to open it as it was more reliable. Look at Order.ahk -> _openOrderForm(). Maybe the menu strings are different
3) About Buy/Sell window close - again need to debug to understand.

If you are free, we can do quick desktop connection to sort it out - perhaps through ammyadmin. Also, do remember to record all changes so that i can do proper code change later ..
 

Mungus

Well-Known Member
#36
TB Sir,I use RTD1.30 for both live data and backfilling.
I was searching for such a tool where I can place an order directly on Amibroker.
So,OrderMan will be a gre8 tool for me.
Sorry for a dumb question,where is the setup file? I dloaded OrderMan - 0.1b and there are many folders inside it.

how to install it,where to keep it?
 

boarders

Well-Known Member
#37
It will be hard to diagnose without debugging, you have to get used to the code flow.

1) B/S does not trigger change. All fields must be set correctly before New order. Only buttons will trigger order change
2) Instead of F1/F2 i use menu to open it as it was more reliable. Look at Order.ahk -> _openOrderForm(). Maybe the menu strings are different
3) About Buy/Sell window close - again need to debug to understand.

If you are free, we can do quick desktop connection to sort it out - perhaps through ammyadmin. Also, do remember to record all changes so that i can do proper code change later ..





sorry, yesterday I went out and did not see your message until this morning, whenever you are free just let me know and we can do ammy connection wherein I will give you user id.

meantime I used the spy and corrected the combo box and edit location numbers as well as the menu buy/sell part in the order ahk. and now everything gets automatically fed except for Symbol part (this is combobox 6
but is edit3 as well. pls see attachment below). the symbol drop down list goes blank totally and throws error. pls see detailed attachment below.
Meantime I will start trading today only from 2 pm as have to go out before that for some work. so will be available for ammy whenever you want after 2 pm so just let me know thru this thread and i will give you my ammy id. many thanks. also from this morning orderman window shows up without tinkering with maximize in Task manager
following are the mods i did in order ahk

_openOrderForm(){
global TITLE_NOW, TITLE_BUY, TITLE_SELL

Loop, 5{ // Try upto 5 times
if( this._input.direction == "B" ){
winTitle := TITLE_BUY
WinMenuSelectItem, %TITLE_NOW%,, Orders and Trades, Order Entry, Buy Order Entry // F1 F2 F3 sometimes (rarely) does not work. Menu Does
}
else if( this._input.direction == "S" ){
winTitle := TITLE_SELL
WinMenuSelectItem, %TITLE_NOW%,, Orders and Trades, Order Entry, Sell Order Entry
}
WinWait, %winTitle%,,2
if !ErrorLevel
break
}
if ErrorLevel
MsgBox, Could not open Buy/Sell Window

return winTitle
}

/* Fill up Buy/Sell Window and Submit
*/
_submitOrder( winTitle ){ // Fill up opened Buy/Sell window and verify

scrip := this._input.scrip
ordertype := this.getNowOrderType()

Control, ChooseString , % scrip.segment, ComboBox1, %winTitle% // Exchange Segment - NFO/NSE etc
Control, ChooseString , % scrip.instrument, ComboBox5, %winTitle% // Inst Name - FUTIDX / EQ etc
Control, ChooseString , % scrip.symbol, ComboBox6, %winTitle% // Scrip Symbol
Control, ChooseString , % scrip.type, ComboBox7, %winTitle% // Type - XX/PE/CE
Control, ChooseString , % scrip.strikePrice, ComboBox8, %winTitle% // Strike Price for options
Control, Choose , % scrip.expiryIndex, ComboBox9, %winTitle% // Expiry Date - Set by Position Index (1/2 etc)

Control, ChooseString , % ordertype, ComboBox3, %winTitle% // Order Type - LIMIT/MARKET/SL/SL-M
Control, ChooseString , % this._input.prodType, ComboBox11, %winTitle% // Prod Type - MIS/NRML/CNC
Control, ChooseString , DAY, ComboBox12, %winTitle% // Validity - Day/IOC

this._submitOrderCommon( winTitle )
}

/* Fills up stuff that is relevant to both create and update orders
*/
_submitOrderCommon( winTitle ){
global TITLE_TRANSACTION_PASSWORD, AutoSubmit

ControlSetText, Edit5, % this._input.qty, %winTitle% // Qty
if( this._input.price != 0 )
ControlSetText, Edit6, % this._input.price, %winTitle% // Price
if( this._input.trigger != 0 )
ControlSetText, Edit8, % this._input.trigger, %winTitle% // Trigger

if( AutoSubmit ){
ControlClick, Button1, %winTitle%,,,, NA // Submit Order
WinWaitClose, %winTitle%, 2 // Wait for order window to close. If password needed, notify
IfWinExist, %TITLE_TRANSACTION_PASSWORD%
MsgBox, 262144,, Enter Transaction password in NOW and then click ok
}




 
Last edited:

TracerBullet

Well-Known Member
#38
TB Sir,I use RTD1.30 for both live data and backfilling.
I was searching for such a tool where I can place an order directly on Amibroker.
So,OrderMan will be a gre8 tool for me.
Sorry for a dumb question,where is the setup file? I dloaded OrderMan - 0.1b and there are many folders inside it.

how to install it,where to keep it?
Its portable. Take the latest code from here (overwrite). i think there was 1 fix that is not in zip.

sorry, yesterday I went out and did not see your message until this morning, whenever you are free just let me know and we can do ammy connection wherein I will give you user id.

meantime I used the spy and corrected the combo box and edit location numbers as well as the menu buy/sell part in the order ahk. and now everything gets automatically fed except for Symbol part (this is combobox 6
but is edit3 as well. pls see attachment below). the symbol drop down list goes blank totally and throws error. pls see detailed attachment below.
yes they are both (Edit2 in NOW). We use the combobox to make sure scrip is taken from available values. Verify that you have correct value in ini. Ex - "Scrip = NSE,EQ,SBIN,XX,,1" - Values should match from B/S order window.

Meantime I will start trading today only from 2 pm as have to go out before that for some work. so will be available for ammy whenever you want after 2 pm so just let me know thru this thread and i will give you my ammy id. many thanks. also from this morning orderman window shows up without tinkering with maximize in Task manager
we can try after say 16:00. i do have some network issues with periodic lag spikes though - hopefully will be ok then. We can try to test NSE scrips by changing stop trigger on order status = rejected Instead of complete.

following are the mods i did in order ahk

_openOrderForm(){
global TITLE_NOW, TITLE_BUY, TITLE_SELL

Loop, 5{ // Try upto 5 times
if( this._input.direction == "B" ){
winTitle := TITLE_BUY
WinMenuSelectItem, %TITLE_NOW%,, Orders and Trades, Order Entry, Buy Order Entry // F1 F2 F3 sometimes (rarely) does not work. Menu Does
}
else if( this._input.direction == "S" ){
winTitle := TITLE_SELL
WinMenuSelectItem, %TITLE_NOW%,, Orders and Trades, Order Entry, Sell Order Entry
}
WinWait, %winTitle%,,2
if !ErrorLevel
break
}
if ErrorLevel
MsgBox, Could not open Buy/Sell Window

return winTitle
}

/* Fill up Buy/Sell Window and Submit
*/
_submitOrder( winTitle ){ // Fill up opened Buy/Sell window and verify

scrip := this._input.scrip
ordertype := this.getNowOrderType()

Control, ChooseString , % scrip.segment, ComboBox1, %winTitle% // Exchange Segment - NFO/NSE etc
Control, ChooseString , % scrip.instrument, ComboBox5, %winTitle% // Inst Name - FUTIDX / EQ etc
Control, ChooseString , % scrip.symbol, ComboBox6, %winTitle% // Scrip Symbol
Control, ChooseString , % scrip.type, ComboBox7, %winTitle% // Type - XX/PE/CE
Control, ChooseString , % scrip.strikePrice, ComboBox8, %winTitle% // Strike Price for options
Control, Choose , % scrip.expiryIndex, ComboBox9, %winTitle% // Expiry Date - Set by Position Index (1/2 etc)

Control, ChooseString , % ordertype, ComboBox3, %winTitle% // Order Type - LIMIT/MARKET/SL/SL-M
Control, ChooseString , % this._input.prodType, ComboBox11, %winTitle% // Prod Type - MIS/NRML/CNC
Control, ChooseString , DAY, ComboBox12, %winTitle% // Validity - Day/IOC

this._submitOrderCommon( winTitle )
}

/* Fills up stuff that is relevant to both create and update orders
*/
_submitOrderCommon( winTitle ){
global TITLE_TRANSACTION_PASSWORD, AutoSubmit

ControlSetText, Edit5, % this._input.qty, %winTitle% // Qty
if( this._input.price != 0 )
ControlSetText, Edit6, % this._input.price, %winTitle% // Price
if( this._input.trigger != 0 )
ControlSetText, Edit8, % this._input.trigger, %winTitle% // Trigger

if( AutoSubmit ){
ControlClick, Button1, %winTitle%,,,, NA // Submit Order
WinWaitClose, %winTitle%, 2 // Wait for order window to close. If password needed, notify
IfWinExist, %TITLE_TRANSACTION_PASSWORD%
MsgBox, 262144,, Enter Transaction password in NOW and then click ok
}




thanks, there are many control changes too, it seems that id changes if there is a new control before it. We will have to verify all ids to be sure else can have hidden bug. Once we have basic flow working ill put all control ids in together as constants to make it easier to compare and override.

Meanwhile, verify the controls in following functions in Orderbook.ahk

cancelSelectedOpenOrder()
selectOpenOrder()
openModifyOrderForm()
 

boarders

Well-Known Member
#39
Its portable. Take the latest code from here (overwrite). i think there was 1 fix that is not in zip.


yes they are both (Edit2 in NOW). We use the combobox to make sure scrip is taken from available values. Verify that you have correct value in ini. Ex - "Scrip = NSE,EQ,SBIN,XX,,1" - Values should match from B/S order window.


we can try after say 16:00. i do have some network issues with periodic lag spikes though - hopefully will be ok then. We can try to test NSE scrips by changing stop trigger on order status = rejected Instead of complete.



thanks, there are many control changes too, it seems that id changes if there is a new control before it. We will have to verify all ids to be sure else can have hidden bug. Once we have basic flow working ill put all control ids in together as constants to make it easier to compare and override.

Meanwhile, verify the controls in following functions in Orderbook.ahk

cancelSelectedOpenOrder()
selectOpenOrder()
openModifyOrderForm()

many thanks I will be here at 1600 hrs onwards. meantime pls note I have NFO and MCX accounts and no equity. but we can try NFO or even mcx with wayout price entries so they dont execute immediately and we can cancel the order once placed. my entry in config file is as follows

Scrip = MCX,FUTCOM,CRUDEOILM,XX,,1

what I have observed is that even without using Hkey if we open buy order entry window and click into the symbol select box and start typing instead of using drop down menu...for example start typing CRUDEOILM...up until the word CRUDE is typed the CRUDEOIL gets autocompleted (NOT CRUDEOILM) and after typing crude the moment "O" for oil is typed, the field goes blank and throws the error "exchange or series or symbol is not selected" the same error we get while using Hkey. So I suspect we may have to use a numbering mode to select scrip as done in expiry date selection.
 

TracerBullet

Well-Known Member
#40
many thanks I will be here at 1600 hrs onwards. meantime pls note I have NFO and MCX accounts and no equity. but we can try NFO or even mcx with wayout price entries so they dont execute immediately and we can cancel the order once placed. my entry in config file is as follows

Scrip = MCX,FUTCOM,CRUDEOILM,XX,,1

what I have observed is that even without using Hkey if we open buy order entry window and click into the symbol select box and start typing instead of using drop down menu...for example start typing CRUDEOILM...up until the word CRUDE is typed the CRUDEOIL gets autocompleted (NOT CRUDEOILM) and after typing crude the moment "O" for oil is typed, the field goes blank and throws the error "exchange or series or symbol is not selected" the same error we get while using Hkey. So I suspect we may have to use a numbering mode to select scrip as done in expiry date selection.
Then this is bug in Nest. As a workaround, try setting the text control with minimum string and check if it completes ( instead of combobox)

Something like below - set correct control and text
Code:
ControlSetText, Edit3, 	   % this._input.qty,     %winTitle%
Edit - oh, it does not take crudeoilm. We can try a workaround code in your case - set minimum value + use up/down arrow until we have match with full string. Cant use index as scrips can change. Just to be sure, select crudeoilm and copy paste string into editor and compare. Maybe its has some slight difference ( 0 instead of O etc).
 
Last edited: