4 Attachment(s)
Visual Order Plugin - follow on post
See attached EA - Ea_easy_order_start (mod - by akitra) - to call Easy Order Script at MT4 start up. Goes in EA folder.
LOT TRADING ONLY
A problem using the Easy Order script for manual Lots trading is that there is no way to lock the script to Lots only. The Visual Easy Order can be accidentally set to Risk which will result in a lot size not intended which can be an unpleasant surprise.
The attached EasyOrder_Submit.mq4 file has been edited to disable the Risk function. Only Lots can be traded with this file. If a trade is taken on the Risk setting an error alert will pop up - the trade will not be placed.
Important:To use this file, first remove file of the same name from the MT4/Experts/Script folder and then replace accordingly.
SL + TP Line delete Indicator - see attached.
1. Assign hot keys combo to EasyOrder.mq4 (e.g. Ctrl + Z)
2. Assign associated hot key codes (162 + 90) to inputs window of SL + TP line delete indicator.
3. See attached Pdf for further info and associated key codes.
4. Warning: Use only with script - NOT with EAs. Ensure that no EA has been assigned the same hot key combo.
This is normally a PDF but would not upload
SL+TP LINE DELETE INDI
Info and Operation see Keycodes below
The Indicator can be used to start scripts only – NOT EAs.
The indicator can be used with Easy Order to delete the SL and TP Lines when orders are close via SL & TP values.
It will also delete SL & TP Lines drawn by Easy Order if orders are closed via the Terminal.
When the Indicator detects that an order has closed it initiates a Hot-key Keybd-event associated with the EasyOrder.mq4 file. The Hot-key Keybd-event causes the Easy Order script to run and it deletes the associated lines.
Setting UP the Indicator
1. Place indicator in in MT4\experts\indicator folder.
2. The default Hot key-Key code combo is: 1st Key: L-Ctrl (162) and 2nd Key: Z (90).
3. Users can define their own combo preference.
4. Assign a Hot-keys combination to the EasyOrder.mq4 file located in the MT4\experts\script folder.
5. Open the KeyCode.pdf or see image, find the corresponding Key Codes and input them into the Indicator (a choice of 3 keys are available for the first key and 36 for the second key.)
6. Ensure that no EA has the same Hot-key combo as assigned to this Indicator.
Note: While testing I discovered that I sometimes keyed in the wrong codes and also that the EasyOrder.mq4 file would still be in the old Hot-key combination while new codes had been assigned to the indicator for a different Hot-key combination. These scenarios will result in failure.
Must have files
1) WinUser32.mqh (should be in the MT4\experts\include folder)
2) User32.dll ( should be in the Windows\System32 folder)
There should be no good reason why these files are not in the relevant folders but would be a 2nd port of call, after checking key codes, if things are not working.
Caution: If you are missing a user32.dll file reliable sources strongly advise not downloading from one of the many download sites on the internet.
Why does Easy Order not delete the lines
My understanding – which sometimes turns out to be a load of twaddle - is that scripts only run once, so once an order is placed and the lines drawn, that is it as far as the
script is concerned. When positions appear to close via SL or TP lines it is MT4 that initiates the close, not the script, and as the script does not run it does not delete the lines. If the Easy Order assigned hot keys are pressed the script will run and delete the lines. The same when positions are close via Easy Order combo window/box, the script runs and deletes the lines.
Extract from Mt/4 Codebase: Script is a program intended for a single execution of some actions. Unlike Expert Advisors, Scripts are not run tickwise, but on request.
Testing in Quiet/Slow Markets
If this indicator is tested in quiet/slow markets it will appear to fail because ticks are few and far between. A marker should be used to assess when a tick event has occurred. Using SL+TP-OE CALC INDY should be suitable. When a positioned is opened there may be a long wait before the text appears at the lines. The appearance of the text at the line indicates that a tick event has taken place. Closing the position before this will result in a failure to delete the lines because a tick event would not have taken place. After the appearance of the text the position can be closed to further the test. It will be noted that after the position is closed the text may remain at the line for an extended period. Yep, its waiting for a tick and the Line Delete Indi is also waiting for a tick. Once the text drops from the chart it is proof that a tick has occurred and the lines should shortly delete followed by the below image appearing on screen. Click OK, its confirmation that the Easy Order script has received the Hot-key Keybd-event.
Support
None. Apology - I do not have time to consider individual problems, though of course if an obvious bug is discovered I will take a look.
Disclaimer: All downloads are offered as demo
Attachment 585
I am busy so may not have time to answer questions - also my time zone is London UK - however, for answers and solutions click relevant links located in above post 35.
Caution: Imperative to test ALL scripts, EA and indicators on Demo.