Using Order Scripts through an EA via Hotkeys - page 2

 
Goldengirl9 #: Hi again Fernando.  Not sure I want the control panel/dashboard as it seems as though details still need to be entered.  I want the trades to be executed once the hotkey is pressed on the keyboard. I am thinking the OnChartEvent is the way to go. The handler may be the connecter.  Will work with it and see if I can make it happen.

Just because the example trading panels have fields to fill in, does not mean yours has to be that way. It can just have buttons to click on with your mouse.

Also, the OnChartEvent() handler in those examples also gives you some insight into using it for the keystrokes too.

You are restraining your thoughts too much. Think a little outside your box.

 
Fernando Carreiro #:

Just because the example trading panels have fields to fill in, does not mean yours has to be that way. It can just have buttons to click on with your mouse.

Also, the OnChartEvent() handler in those examples also gives you some insight into using it for the keystrokes too.

You are restraining your thoughts too much. Think a little outside your box.

Thanks Fernando.  Will do.

I am very new to this world of coding. I will take your suggestion to heart and start thinking more outside the box.  I will begin working with the OnChartEvent() handler soon. I hope I can get it to work ;). I just want to be able to open and close trades via hotkeys or using a trading panel with one click. Will keep you posted...

 
Goldengirl9 #:

Thanks Fernando.  Will do.

I am very new to this world of coding. I will take your suggestion to heart and start thinking more outside the box.  I will begin working with the OnChartEvent() handler soon. I hope I can get it to work ;). I just want to be able to open and close trades via hotkeys or using a trading panel with one click. Will keep you posted...

Hi again Fernando.  

This may a bit advanced for me as I am not clear as to what exactly is needed for the lparam, dparam and sparam.  Also, if I placed each script in an EA, would I need to create separate OnChartEvents() for each script in the same EA in order for each script to be activated?

Honestly, feel as though I am going in circles at the moment.  Will try at another time.

 
Goldengirl9 #:

Hi again Fernando.  

This may a bit advanced for me as I am not clear as to what exactly is needed for the lparam, dparam and sparam.  Also, if I placed each script in an EA, would I need to create separate OnChartEvents() for each script in the same EA in order for each script to be activated?

Honestly, feel as though I am going in circles at the moment.  Will try at another time.

Any idea where I can find an advanced MQL4 programming course? Thanks in advance for your reply.

 

Hi Fernando,

Just wanted to let you know that I found a likely workaround using the panel options.  Thanks a lot for your help.  I may need to refine things a little, but I should be able to work with it to achieve my goals for now.  Your assistance is greatly appreciated.  Thanks a million ;).

 
Goldengirl9 #: Just wanted to let you know that I found a likely workaround using the panel options.  Thanks a lot for your help.  I may need to refine things a little, but I should be able to work with it to achieve my goals for now.  Your assistance is greatly appreciated.  Thanks a million ;).
You are welcome!
 
Goldengirl9 #: Any idea where I can find an advanced MQL4 programming course? Thanks in advance for your reply.

Not really, as MQL4 has become stagnant due to it no longer being actively developed by MetaQuotes. Everything is now focused on MQL5.

However, the following book may be of assistance:

Forum on trading, automated trading systems and testing trading strategies

Something Interesting to Read

Sergey Golubev, 2017.09.16 05:40

Expert Advisor Programming for MetaTrader 4


This book will teach you the following concepts:

  • The basic of the MLQ4 language, including variables and data types, operations, conditional and loop operators, functions, classes and objects, event handlers and more.
  • Place, modify and close market and pending orders.
  • Add a stop loss and/or take profit price to an individual order, or to multiple orders.
  • Close orders individually or by order type.
  • Get a total of all currently opened orders.
  • Work with OHLC bar data and locate basic candlestick patterns.
  • Find the highest high and lowest low of recent bars.
  • Work with MetaTrader’s built-in indicators, as well as custom indicators.
  • Add a trailing stop or break even stop feature to an expert advisor.
  • Use money management and lot size verification techniques.
  • Add a flexible trading timer to an expert advisor.
  • Construct several types of trading systems, including trend, counter-trend and breakout systems.
  • Add alert, emails, sounds and other notifications.
  • Add and manipulate chart objects.
  • Read and write to CSV files.
  • Construct basic indicators, scripts and libraries.
  • Learn how to effective debug your programs, and use the Strategy Tester to test your strategies.

All of the source code in this book is available for download, including an expert advisor framework that allows you to build robust and fully-featured expert advisors with minimal effort.


 
Fernando Carreiro #:

Not really, as MQL4 has become stagnant due to it no longer being actively developed by MetaQuotes. Everything is now focused on MQL5.

However, the following book may be of assistance:


Thanks Fernando.  I will definitely check it out.

 

Hello...
I not have coding skill..

can you help me with that?

I need one EA that execute keyboard moves when equity is +$x.xx or -$x.xx

the command is "CTRL + F" wait  150ms  and  press "enter"


MetaTrader 5.

Reason: