It's incredibly simple to get Mark's script to work: 1. Download his latest zip file. 2. Open the zip file and copy the auto_confirm file into your \Jts folder. 3. Run the auto_confirm executable and that's it.
you can copy the auto_confirm file.exe in any folder you want, even your desktop is ok. Just run it and you are ready to use it
Hi Mark, Cool vid. So hopefully no one has trouble with ibcontroller installation and running after your tutorial. In the future you can find newer versions of ibcontroller here. In the next release the one click feature will be added I was told. http://sourceforge.net/projects/ibcontroller/ Good trading! Asterix.
I have written my own auto-confirmation tool largely based on mark1's code (thanks for that, it saved me an awful lot of time), and I encountered a problem that may be related to what I've read here. The Transmit button of the Order Confirmation window gets clicked all right, but after that there is an additional click at the relative coordinates of the BookTrader window that spawned the Order Confirmation. This extra click can be detected by adding a GUI Button at that position which triggers a MsgBox, and it is definitely what has been happening to me. SetWinDelay may affect this, but since the problem only showed up after some changes I made yesterday, and I'm not working on it during trading, I haven't been able to confirm it.
Thanks for your input. What you say is right, the second click was added because when you move booktrader near the left edge of the primary monitor (the one identified with 1 in "display properties") or on any monitor on the left of the primary monitor, the positon of the "transmit" button inside the "confirmation window" changes from bottom-right to bottom-left. My quick fix was to add a second click that always triggers even when the position of the "transmit button" is on the right. I calculated these coordinates so that when the button is on the right the click on the left "lands" in a empty area of the confirmation window. Now, what happens is that if booktrader is sized too narrow, this second click "lands" on any window placed behind booktrader. This is probably why Pev whas having this "weird" behaviour (random windows opening up after the confirmation). Since I place my booktrader on an empty area of my desktop , I wasn't able to recreate the problem. There's a solution though: I have to Back-engineering (big word to say :I have to click and measure coordinates like an idiot...lol) the exact coordinates where the confirmation window changes its "transmit" button from bottom-right to left-right, then I have to add an if statement: if "confirmation window" x coordinate is less than (number i have to find) then click on the left, else click on the right. I actually already tried something like that and noticed that this slowed down a bit the execution of the script, so in the end I decided to choose the easy solution. Now I see it can create some problem, thus I'm gonna change the script again. Thank you guys for your input, you are my offiicial guinea pigs..herm I mean beta testers Without your help I wouldn't have noticed that. I hope we can arrive to a definitive release...and you can bet your @ss it's gonna be when IB decides to bring back the confirmation order choice... isn't always like that ? hehe
Hmmm, I definitely only have one Click command in my Loop (I think I used your V.3 as, ahem, inspiration), and I still get the second click. Based on my observation that "SetWinDelay, 100" (though I haven't been able to pinpoint how low it can go without causing trouble) seems to get rid of the second click, I assume (disclaimer: I've only started using AHK last weekend, so my knowledge of how it does what it does is a bit sketchy, to say the least) that the Order Window gets activated, the Click is sent - so far, so good. But MAYBE then it stays on the screen for a few more milliseconds, and the Loop gets executed once more, only by the time the Click is sent, the Order Confirmation window is gone and Click goes to the previously activated window, which is the BookTrader. I've just added a "Sleep, 100" at the end of the Loop, tried it with the Demo, and it seems to be working. This is how my Loop looks now: Code: ... SetWinDelay, 0 ... Loop { WinWait, Order Confirmation WinWaitActive, Order Confirmation CoordMode, Mouse, Screen MouseGetPos, xpos, ypos CoordMode, Mouse, Relative Click 284,103 CoordMode, Mouse, Screen MouseMove, xpos, ypos Sleep, 100 } Return Upon further testing, even "Sleep, 10" seems to be enough. Also, as far as finding the correct button position is concerned, one might try using PixelGetColor on likely locations.
Good observations, you could use WinWaitClose like this: Loop { WinWait, Order Confirmation WinWaitActive, Order Confirmation CoordMode, Mouse, Screen MouseGetPos, xpos, ypos CoordMode, Mouse, Relative Click 284,103 WinWaitClose, Order Confirmation ; Script waits for Order conf. window to close down before executing next line CoordMode, Mouse, Screen MouseMove, xpos, ypos } Probably is going to slow down a bit the script, but that way you don't need to rely on an "arbitrary" sleep time. PixelGetColor , nice idea
Right, you did have that line commented out in your original code. This is so much better than Sleep because it doesn't depend on thread priorities, CPU load etc., which was a bit of a concern - you're either wasting time or risking strange behavior.