summary of all changes done until now.
1. using find-replace, replaced NowOrderNo to NestOrderNo. in all ahk files
2. using find-replace, replaced NowUpdateTime to NestUpdateTime. in all ahk files
3. in OrderMan.ahk: TITLE_NOW := (this shud be same as individual Nest Trader title)
4. following changes 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
}
----------flow sequencing and comboboxes numbering changed in below part--------------
_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.type, ComboBox7, %winTitle% // Type - XX/PE/CE
Control, ChooseString , % scrip.instrument, ComboBox5, %winTitle% // Inst Name - FUTIDX / EQ etc
Control, ChooseString , % scrip.Symbol, ComboBox6, %winTitle% // Scrip Symbol
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 )
}
----------------------edit box numbering changed in below----------------
_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
}
WinWaitClose, %winTitle%
}
--------------------------------------
5. following changes to OrderBook.ahk.....
a) Removed Pending Qty from readColumnHeaders() - Completed Orders headers and keys
b) readCompletedOrders(){
global TITLE_ORDER_BOOK
this.open()
this.CompletedOrders := {}
this.CompletedOrders.size := 0
index := this._completedOrdersColumnIndex
ControlGet, completedOrdersRaw, List, , SysListView322, %TITLE_ORDER_BOOK%
Loop, Parse, completedOrdersRaw, `n
{
order := new OrderDetailsClass
Loop, Parse, A_LoopField, %A_Tab%
{
if( A_Index == index.orderType )
order.orderType := A_LoopField
else if( A_Index == index.buySell )
order.buySell := A_LoopField
else if( A_Index == index.tradingSymbol )
order.tradingSymbol := A_LoopField
else if( A_Index == index.totalQty )
order.totalQty := A_LoopField
//else if( A_Index == index.pendingQty )
//order.pendingQty := A_LoopField
else if( A_Index == index.price )
order.price := A_LoopField
else if( A_Index == index.triggerPrice )
order.triggerPrice := A_LoopField
else if( A_Index == index.averagePrice )
order.averagePrice := A_LoopField
else if( A_Index == index.status )
order.status := A_LoopField
else if( A_Index == index.NestOrderNo )
order.NestOrderNo := A_LoopField
else if( A_Index == index.NestUpdateTime )
order.NestUpdateTime := A_LoopField
else if( A_Index == index.rejectionReason )
order.rejectionReason := A_LoopField
}
---------------------------------
openModifyOrderForm( NestOrderNo, winTitle ){
global TITLE_ORDER_BOOK
if( this.selectOpenOrder( NestOrderNo ) ){
Loop, 5{
ControlClick, Button1, %TITLE_ORDER_BOOK%,,,, NA
WinWait, %winTitle%,,2
if !ErrorLevel
return true
}
MsgBox, Could not open Buy/Sell Window
return false
}
else{
MsgBox, Order %NestOrderNo% Not Found in OrderBook > Open Orders
return false
}
}
--------------------------------
cancelSelectedOpenOrder(){
global TITLE_ORDER_BOOK
window := "NOW"
windowText := "Cancel These Order"
ControlClick, Button2, %TITLE_ORDER_BOOK%,,,, NA // Click Cancel
WinWait, %window%, %windowText%, 1
WinSet, Transparent, 1, %window%, %windowText%
ControlClick, Button1, %window%, %windowText%,,, NA // Click ok
}
todo:
1. target order placement
2. modify target
3. cancel target
4. adds
5. check AMIbroker chart interface
6. ninja chart interface