My knowledge about script is very little. I want a SCRIPT which will be increase my stop loss level if my profit goes up but if i am losing then my stop loss remain there.example- If my order is buy-1.3550 and I give my stop loss level at 1.3500 after some time if market prise goes to 1.3600 then I want my script automatically incrise stoploss 1.3560. After that market fall and I want stop loss will remain 1.3560. can you help me??? please give install instruction also.
This is basically called Trailing stop
thanks for your help. Where can I find Trailing stop? do you use it? it is good or bad?
I don’t know if it is good or bad, it depends on one’s perception and the strategy. Just like everything in Fx. The idea of Trailing stop is to be used in trends. It’s not so far from simple MA crossing method.
I don’t know what trading platform do you use. Maybe MetaTrader, maybe other. In case of MetaTrader 4 you can try this simple example just to see what Trailing stop does:
This is expert advisor example, not a script. It’s not profitable, even no strategy inside. Just to see and feel how trailing stop basically works in all situations - trend, range, opposite trend.
It creates buy position when there is no such available and trails stop behind it. There are 2 buttons for exporting .mq4 or .ex4 file formats. Place .ex4 (compiled file) in MetaTrader 4’s “experts” subfolder and use tester to visualize it. It’s good to use “Visual mode” option to see what actually happens.
And you have to know if you need a Script or Expert advisor. In MetaTrader expert advisors runs constantly (at each tick), but scripts only when you double click them, so they are semi-automatic.
Thanks for your help and first time I see this type of site but I can not make any account. how you make account there?
Please help me Little more, my broker is Liteforex and I use MetaTrader 4. I copy your mq4 and ex4 in to “experts” folder but I am not sure it is working or not. I try it my sell order. is your script for buy order??? If you modify your FXDreema - TrailingStop, then make lot-0.10 and make different very small so that I can see with in a minute it is working. like if market go from 1.3050 to 1.3052 SL will increase 1 (from 1.3000 to 1.3001).
Well, you can always search for ea’s, scripts and indicators in “Code base” in mql4.com. For example:
MQL4: search
There are many results for trailing stops and different variations of it.
Also read here to know the difference between “expert advisors”, “scripts”, “custom indicators”… for MT4 and how to use them:
MQL4 Documentation
Google is also usable. I found this searching for “mt4 tools”:
Free Mt4 Tools | Expert Advisors | Metatrader Scripts - DeltaFins
On the example I gave you above - this is some kind of shared strategy and looks like a screenshot of the strategy + links to files, but is also “alive” so the main strategy can be changed and files you get will always meet the new version of the strategy. Whenever you refresh the page - strategy will reset.
And as I told you above, this is an expert advisor, so the “Trailing stop” checks positions all the time.
In addition I placed “Instand buy” in case of testing - something like a generator of positions, but you can remove it from the strategy.
I didn’t test it on the real or demo account actually, but I think it should work. There is one option “Orders group” that for this shared strategy is the Magic number. Magic numbers for manual putted orders and positions is always 0. But if you want to set this to work with all available orders, set “Apply to” option in “If positions” and “Trailing stop” blocks to “All orders”.
Properties of each block shows with right-clicking. In the example I placed properties for thow of the blocks already opened.
This should work with buy and sell positions. Additionally I make this strategy to auto-detect broker digits, so 100 pips for 5-digits broker is the same amount of money like 100 pips in 4-digits broker. Also I set it to be ECN brokers ready.
But if somethins not works as expected you have to know that this is the first shared strategy I made
thanks for your help. It is very helpful.