stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Using hotkey to run Script from EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=170
Page 1 of 1
Author:  Alpenkorps [ Mon Dec 19, 2011 7:44 pm ]
Post subject:  Using hotkey to run Script from EA

I am planning to build a Hotkey EA that can do basic order management (like buy,sell,close thingy).

Could any of guys please show me how to run/execute a script with Hotkey from an EA? or even better, build the script into the EA?

Thanks in advance.
Author:  gaheitman [ Mon Dec 19, 2011 8:14 pm ]
Post subject:  Re: Using hotkey to run Script from EA

Alpenkorps wrote:I am planning to build a Hotkey EA that can do basic order management (like buy,sell,close thingy).

Could any of guys please show me how to run/execute a script with Hotkey from an EA? or even better, build the script into the EA?

Thanks in advance.
If you right-click on a script in the Navigator window, you can set a hotkey to call it automatically. I considered doing order entry with hotkeys years ago, but I wasn't happy with the responsiveness. I'd rather drop the script on the chart so I can take advantage of WindowPriceOnDropped() to place pending order where appropriate or to move SL/TP.

Is there are specific reason you want to use keystrokes to trigger events?

George
Author:  Alpenkorps [ Mon Dec 19, 2011 10:59 pm ]
Post subject:  Re: Using hotkey to run Script from EA

Thanks for answering Goerge, You are the best :mrgreen:

The idea is to have a little edge in fast (very fast) scalping (on Tic chart or 1M data) when time needed for pressing F9 to make a order or going to terminal to close it could make a difference between winning and losing. Currently I am also using the manual assigned hotkeys to deploy script. Then I thought it would be cool to have such an EA that can alone do jobs ..

I know it is possible, I have seen EA's before that can take command from hotkeys. I don't understand about the response problem though, I thought it would be faster than dragging a script over chart.

Attached document is a manual of such an EA, I never got my hands on it. My plan is to make something close (of-course with some extra things that I use).
Author:  gaheitman [ Tue Dec 20, 2011 12:53 am ]
Post subject:  Re: Using hotkey to run Script from EA

Alpenkorps wrote:Thanks for answering Goerge, You are the best :mrgreen:

The idea is to have a little edge in fast (very fast) scalping (on Tic chart or 1M data) when time needed for pressing F9 to make a order or going to terminal to close it could make a difference between winning and losing. Currently I am also using the manual assigned hotkeys to deploy script. Then I thought it would be cool to have such an EA that can alone do jobs ..

I know it is possible, I have seen EA's before that can take command from hotkeys. I don't understand about the response problem though, I thought it would be faster than dragging a script over chart.

Attached document is a manual of such an EA, I never got my hands on it. My plan is to make something close (of-course with some extra things that I use).
Good ol' Google. Apparently, you can use an API call to interrogate the key states and react to them. http://www.Empty4.info/node/167

I haven't run the code yet, but will likely look into it when I get up in a scant few hours. Though with the way the euro ground to a halt today I may have been the only one trading. :D

I'll probably look at adding Close-All, Pause Trading, Start Trading "events" to the main start loop of the shell code and see what we get. Looks like fun.

George
Author:  Alpenkorps [ Tue Dec 20, 2011 1:28 am ]
Post subject:  Re: Using hotkey to run Script from EA

gaheitman wrote: Good ol' Google. Apparently, you can use an API call to interrogate the key states and react to them. http://www.Empty4.info/node/167

I haven't run the code yet, but will likely look into it when I get up in a scant few hours. Though with the way the euro ground to a halt today I may have been the only one trading. :D

I'll probably look at adding Close-All, Pause Trading, Start Trading "events" to the main start loop of the shell code and see what we get. Looks like fun.

George
Great ! You are simply awesome :D
Author:  AnotherBrian [ Wed Dec 21, 2011 4:12 pm ]
Post subject:  Re: Using hotkey to run Script from EA

I tried this, I can't remember why but sometimes the keyboard commands went to all the charts... it could have been a bug.
Also, you need a tick for this to react, consider this when programming. I'm switching to hot keys for my use (not the same functionality as your looking for). Just heads up to be careful, Empty4 isn't the greatest tool in the world.
All times are UTC Page 1 of 1