OrderMan - Ordering interface for NOW + Amibroker

TracerBullet

Well-Known Member
There it is.


Original Stop was at 524.9. Entry made at 525.15 with 'Limit' Order. Stop Order created immediately. It was SL-M (Trigger at 524.9 and Price 0). I changed stop to 525.5 immediately and clicked 'Update'. NOW complained. See, the order is 'Limit' instead of 'SL'.

We have to figure out why Stop order changed to 'Limit'. It should always be 'SL' or 'SL-M'
ok good we have clue, so problem is with ordertype getting reset to LIMIT.
I just did test - created LIMIT entry, stop created immediately. Then updated stop, updated. So with Zerodha + NOW seems ok. I thought NOW is same for all.

Now in update flow, we do not set ordertype as ordertype change is not supported. Certainly not for stops. So,
1) First try manually, what is stop ordertype if you open modify order of stop from orderbook. Most likely it should be same, but just verify its not reset to LIMIT
2) If 1 is ok, you can try to get used to debugging with Scite. Run Orderman.ahk from scite using debug (F7/Green Bug button). You may need to hit F5/Run for application to start as it stops at first line after F7.
Now, Put breakpoint at start of _submitOrderCommon() in Order.ahk. Then in update flow will stop at that line. Then you can debug line by line and after each line check if it is causing change in Stop order type. We need to check what line in ahk is causing ordertype to be reset to LIMIT.
 

josh1

Well-Known Member
ok good we have clue, so problem is with ordertype getting reset to LIMIT.
I just did test - created LIMIT entry, stop created immediately. Then updated stop, updated. So with Zerodha + NOW seems ok. I thought NOW is same for all.

Now in update flow, we do not set ordertype as ordertype change is not supported. Certainly not for stops. So,
1) First try manually, what is stop ordertype if you open modify order of stop from orderbook. Most likely it should be same, but just verify its not reset to LIMIT
2) If 1 is ok, you can try to get used to debugging with Scite. Run Orderman.ahk from scite using debug (F7/Green Bug button). You may need to hit F5/Run for application to start as it stops at first line after F7.
Now, Put breakpoint at start of _submitOrderCommon() in Order.ahk. Then in update flow will stop at that line. Then you can debug line by line and after each line check if it is causing change in Stop order type. We need to check what line in ahk is causing ordertype to be reset to LIMIT.
Stop Order type is SL-M in the beginning. That is confirmed. (In my case it is SL and Price is 0. Trigger is as set properly. Order Book shows it as SL-M.).

It did not stop at _submitOrderCommon() in Order.ahk. It did not even open Order.ahk.
I guess this is happening when initial entry is Limit. Edit - No. happens randomly. :annoyed:
 
Last edited:

TracerBullet

Well-Known Member
Stop Order type is SL-M in the beginning. That is confirmed. (In my case it is SL and Price is 0. Trigger is as set properly. Order Book shows it as SL-M.).

It did not stop at _submitOrderCommon() in Order.ahk. It did not even open Order.ahk.
I guess this is happening when initial entry is Limit. Edit - No. happens randomly. :annoyed:
It should stop if you put breakpoint and run orderman using debug option. Else put breakpoint earlier in Trade.ahk or do debug just after getting message.

If you are stuck, ping me and ill connect to your desktop. This should be easier to debug as we can do only Limit + stop orders and so no need to enter any position
 

josh1

Well-Known Member
It should stop if you put breakpoint and run orderman using debug option. Else put breakpoint earlier in Trade.ahk or do debug just after getting message.

If you are stuck, ping me and ill connect to your desktop. This should be easier to debug as we can do only Limit + stop orders and so no need to enter any position
I did put a breakpoint but it wouldn't stop.
Na, we have to enter position. How will stop order be entered otherwise? I am testing with 1 share of Axisbank.

I like this app. Order entries and updates happen in a jiffy.
 

TracerBullet

Well-Known Member
I did put a breakpoint but it wouldn't stop.
Na, we have to enter position. How will stop order be entered otherwise? I am testing with 1 share of Axisbank.

I like this app. Order entries and updates happen in a jiffy.
Stop for limit orders are created immediately. No need to wait for Entry to trigger
 
TracerBullet,

There is a problem I am facing continuously with OM.
If I try to link orders, then it shows a new window titled 'Link Order'. In this window, there are two sections : First one is 'Select Entry Order' and the second one is 'Select Stop. Target Order'.
The problem is that, in the second window, only executed orders are visible.
Existing stop orders (placed manually by me, for the open position) does not appear in the 'Select Stop. Target Order' windows.
So, naturally, I am not able to select stop order for my existing position.
Hence, I am not able to link orders.

This is a problem I am facing continuously for last 2-3 months (ever since I started using OM).
Its after 2-3 months, that I have decided to let you know about this problem...


NOTE: I am facing this problem in both SAS-NEST and TSO-NEST platforms.

Thanks for building such a great utility and then distributing it among us.
 
Last edited:

TracerBullet

Well-Known Member
TracerBullet,

There is a problem I am facing continuously with OM.
If I try to link orders, then it shows a new window titled 'Link Order'. In this window, there are two sections : First one is 'Select Entry Order' and the second one is 'Select Stop. Target Order'.
The problem is that, in the second window, only executed orders are visible.
Existing stop orders (placed manually by me, for the open position) does not appear in the 'Select Stop. Target Order' windows.
So, naturally, I am not able to select stop order for my existing position.
Hence, I am not able to link orders.

This is a problem I am facing continuously for last 2-3 months (ever since I started using OM).
Its after 2-3 months, that I have decided to let you know about this problem...


NOTE: I am facing this problem in both SAS-NEST and TSO-NEST platforms.

Thanks for building such a great utility and then distributing it among us.
1) you dont need to wait for months to report issue. I may or may not help, but no need to suffer issue without complaining :)
2) Why do you create stop manually? Due you use SL-Limit ? In latest version, you have option to use SL-Limit as stop type. It will set price as 0 so should act as SLM. You can take latest code from github and overwrite files.
3) Anyway, probable bug is in Gui.ahk, function onLinkOrdersDirectionSelect()

Code:
	Loop, % orderbookObj.OpenOrders.size {				// Open Stop and target
		o :=  orderbookObj.OpenOrders[A_Index]
		[B]if( o.orderType == controlObj.ORDER_TYPE_SL_MARKET && o.buySell == stopDirection)[/B]
			addOrderRow( o, "Stop" )
		if( o.orderType == controlObj.ORDER_TYPE_LIMIT && o.buySell == stopDirection)
			addOrderRow( o, "Target" )					// // filter: Open + SLM + stop direction
	}
In above code, we are expecting stop order type to be SLM. SL Limit check was not added as initially we didnt use it.

So fix is below 1 line change, i have not tested it but it should work - please check and confirm

Code:
[B]if( (o.orderType == controlObj.ORDER_TYPE_SL_MARKET || o.orderType == controlObj.ORDER_TYPE_SL_LIMIT)  && o.buySell == stopDirection)[/B]
			addOrderRow( o, "Stop" )
 
Dear TracerBullet,
I downloaded the latest build of OrderMan and its working pretty well..

But, there is a problem. While placing SL-Limit order (not manually, but by the OM), it does not put '0' as the Limit price. It just lets the Limit price remain the current market price.
Due to this a window pops us saying 'Limit price cannot be greater than Trigger Price'.
Then, I have to manually intervene and put '0' as the Limit price.

Thanks
 

TracerBullet

Well-Known Member
Dear TracerBullet,
I downloaded the latest build of OrderMan and its working pretty well..

But, there is a problem. While placing SL-Limit order (not manually, but by the OM), it does not put '0' as the Limit price. It just lets the Limit price remain the current market price.
Due to this a window pops us saying 'Limit price cannot be greater than Trigger Price'.
Then, I have to manually intervene and put '0' as the Limit price.

Thanks
I have not tested Stop Order as Stop Limit yet, but josh is using it and i saw it work fine over remote desktop. So first check this - remove the alert prompt from preferences( There is a per segment/exchange setting in Orders i think). Then test (with small entry size) and check if price is still not 0 for your stop order.

I will get account with SASOnline in a week or so, Will test it then. Also, as i understand you can ask them to enable SLM orders too. Its just not enabled by default.