Using hotkey to run Script from EA

Post Reply
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Using hotkey to run Script from EA

Post by Alpenkorps »

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.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Using hotkey to run Script from EA

Post by gaheitman »

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
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Re: Using hotkey to run Script from EA

Post by Alpenkorps »

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).
You do not have the required permissions to view the files attached to this post.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Using hotkey to run Script from EA

Post by gaheitman »

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
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Re: Using hotkey to run Script from EA

Post by Alpenkorps »

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
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
AnotherBrian

Re: Using hotkey to run Script from EA

Post by AnotherBrian »

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.
Post Reply

Return to “Coders Hangout”