|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
script for trailing stop needed please?
I am developing my first ea right now and I am having trouble with a trailing stop. I can initiate an instant buy or sell order but I do not know how to give it a trailing stop. Can anyone help me with this. I am currently using an
OrderSend function for the instant orders. If someone could please tell me how to add a trailing stop to this, I would really appreciate it. thank you |
|
|||
|
Quote:
Trailing Stop EA E-ASEClose Expert from KIMIV Trailing file Also you may visit EA template page with the codes for trailing stop: Templates to create EAs and Indicators Kalenzo posted stop and trailing stop code somewhere here: Wma 5/20 - Ema |
|
||||
|
Quote:
Thanks in advance Dave |
|
||||
|
Quote:
These links do not seem to help in creating a trailing stop script!!!! |
|
||||
|
Quote:
When I use this script as a script to just drag over a graph it does not reflect activation has taken place. If I use a modify script, and then right click the mouse and select modify or delete order, the modify script settings are reflected in the modify window. But if I use your trailing stop script it does not reflect in the right click mouse - trailing stop window. This is the problem - How do I know if the trailing stop is even activated?? PHP Code:
|
|
|||
|
Script to modify the order by mouse.
I tried it long time ago and it worked. It is translation from Russian: Code:
Instruction for installation: 1. Open script in MetaEditor and set your desirable default settings. Default settings in the script are started and finished by this line //+--------------------------+ 2. In Metarader: go to Tools, Options, Expert Advosirs and select "Allow external experts import". 3. Move script to the chart by mouse just near the order which you want to modify. 4. Move all the lines to the necessary levels: - Open_Price_Line (white color by default) - price to open the order (for pending orders only); - Stop_Loss_Line (red color) - stop loss level; - Take_Profit_Line (green color) - take profit level; - Expiration_Line (yellow) - for pending orders only. To remove stop loss, take profit, expiration date so just delete the lines on the chart (by mouse). Move the lines by mouse on the chart to modify the order. Code:
Order_Find_Radius = 10; Code:
Take_Profit = 50; int Stop_Loss = 50; Code:
Slippage = 5; Code:
Expiration_Shift = 0; How to use this script: 1. Open the order. 2. Move this script by mouse to the place with order price on the chart. If you get the error so it means that you are not sniper and you moved the script far away from the order on the chart. Just increase Order_Find_Radius value in this case. I prefer 20 for example (20 pips target aroud the order open price on the chart). 3. Wait. Pop up window will be opened (see image attached). Ignore this pop-up window (do not click on "OK" or "Cancel", just ignore). If this pop-up window prevent you to see or move the lines on the chart so just move this window to somewhere by mouse. 4. You should see the lines. Just wait 2 or 3 seconds. To speed up this process, or if you do not see red/green stop loss and take profit lines so simple click on the chart by mouse in any place. 5. Move take profit line and stop loss line what ven distance you want (by mouse on the chart). How to move? Double mouse click on the line and move. 6. So, now only you may press "OK" in pop-up window. Afer that order will be modified. 7. If you want to modify once again so move this script to the "open order place" and repeat it. It looks complicated but it is very simple. Just set your desirable Order_Find_Radius and use your mouse. Last edited by newdigital : 06-14-2007 at 05:47 PM. |
|
||||
|
Script ?
The code I provided (and most TS code that exists) works in EAs.
There are 2 ways to see the TS works - Red SL line on a chart, corresponding to TS level will be moving once your trade made profit of TS value and the Terminal 'S/L' value will be changing as well. EA will show a 'smiling face' icon in the right top corner of the chart. There are many variations and options of TS code. In general, scripts are meant to be used for a one-off execution, while TS needs to be reviewed on every tick. I find the method explained by newdigital above awkward to use, but that is MQ4 limitation. Last edited by european : 06-14-2007 at 06:43 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ATR Trailing Stop - Help | Boiseboy | Indicators - Metatrader 4 | 51 | 07-08-2008 04:39 AM |
| Help Needed Making Perfect Trailing Stop EA | sbwent | Expert Advisors - Metatrader 4 | 27 | 03-13-2008 04:30 AM |
| Trailing Stop Script - Not EA | iscuba11 | Tools and utilities | 3 | 07-02-2007 02:22 PM |