I’ve searched high and low but can’t seem to find anything that can do this for me.
Its basically for my STOP LOSS. In MT4 you can set a stop loss price, the only problem with this is that it will close the trade if price hits this number or goes past it. But I don’t want it to do this. I only want it to close the trade if the candle CLOSES past my stop loss price.
Seems so simple I can’t believe nobody else has ever needed something like this. Am I the only one out there that uses closing prices for stops instead of the current price?
You need a close orders script.
To do this you will have to set your regular stop loss higher than you would normaly do, consider it a failsafe.
Then use a script to close orders if the stop loss criteria you really want is met.
This would not be as safe as a regular stop loss as it is not sent with the order so if the close order script failed for some reason you would need your failsafe stop loss to prevent a catastrophe.
In the script you can’t just use the close price because in mt4 the close price is every price quote, this is because the actual close price cannot be defined until the candle is finished forming so mt4 uses the last price quote as the close price until the candle finished, I know this is stupid, mt4 is sloppily coded in many ways that is just one of them, anyway, what you can do is code the script to use the open price of the next candle, which is the very next price quote after the previous candle has finished forming, or you could use the time to sync your script to the time the candle will finish.
If you use the open price of the next candle you would code your script to close orders if the profit is negative x amount of pips, at the open price of the candle.
It would be more complicated to code a script to use the time to get the actual close price of the candle as it depends on the timeframe of the chart you are using but you could code it to close orders if the profit is negative x amount of pips and the time is the close time of the candle.
A script no matter how cleverly coded won’t be suitable for this kind of task. The trader doesn’t want to sit at the screen and execute it at precisely the right moment - he do that with the trading platform. An EAs is needed to do tasks like this.
Yes your right I wasnt thinking about the once only executuion of a script I dont use them I only use EA’s and indicators.
An EA would keep checking if the close orders criteria is true at every tick and would be the way to do it.
I trade by using MA ea at TF1H and close TP for only 5pips per post. I run for 10 pair at one time and got very huge result for 80% profit half day.
The problem is the ea will open post so many time after the first post close TP. This problem will make my trade hit SL so many time and drain my profit. I need help coder to put coding in my EA to [B]put trade limit for 1 signal[/B]. Meaning if we put “5” then ea only just will open post for 5 times per signal valid by MA crossing. After the limit post is hit then ea will not open new post anymore but will wait until new crossing MA as a new signal.
Supra, PM me for a possible solution. There are a couple ways to control trade rentry (#1 - your entry condition), next bar delays, conditions, etc. It kinda depends on your core EA logic which is hard to examine without the actual EA to brainstorm.
I went through my MA cross phase and you can get 1 entry/exit per cross but its tricky coding but is needed to preserve profit from successful crosses and reduce losses from tight ranges that can kills ALL earnings.
Last week, I bought the GBPUSD before reversal. I put the stop loss on the lowest candlestick’s tail. It hit the stop loss! I lost four hundred dollars. Now, the prices reversal & make much higher than my initial entry price.
I found the EA in the link below.
This EA is a trendline EA. It service my purpose but very expensive. $$$
I am searching for the same thing, for EA to close trade based on CLOSING price of the candle instead of current price
I also only want it to close the trade if the candle CLOSES past my stop loss price. Have you been succesful in your searching? I would be very glad to hear from you. Regards, Goekce.