MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Have Something to Say to Traders? Welcome to Blogs!

trailing stop loss calculation question - on bar close price or calc and set in real time?

Back to topics list To post a new topic, please log in or register
avatar
39
idh 2013.12.31 21:26
 

Hi

I'm coding up some trailing stop loss functionality for my EA. I was wondering what people's thoughts/opinions are with regards to using Moving averages as basis for stop loss, or something like ATR?

But my main question is, assuming I use a moving average, would it be better to recalculate and adjust my stop loss on the previous bar's close price, or do people generally do it in real time for each incoming tick. I know a lot of EAs tend to wait for a new bar before executing a buy or sell on a given signal, but I wondered whether the same practice is also wise for setting Stop losses. If I do it in real time for each tick, it seems less stable to me and more prone to whipsaw..

Any thoughts ?

 
World Events: Countdown to Apocalypse?
World Events: Countdown to Apocalypse?
Matthew Todorovski | 18 December 2014, 12:42 | Views: 120
Blood Moon WINDOW End Times Prophetic Events, Dec. 8, 2014 Posted by :pgrevas On : December 9, 2014 Thank you for viewing.  We are now 45% completed in our Creator’s Heavenly SIGNS of these 4 Biblical Blood Moons (BBMs).  They are for real. Something BIG is about to happen.  Please don’t say:  ”yeah right”.
avatar
Moderator
3854
ubzen 2014.01.01 00:07 #
 
idh: I'm coding up some trailing stop loss functionality for my EA. I was wondering what people's thoughts/opinions are with regards to using Moving averages as basis for stop loss, or something like ATR?

But my main question is, assuming I use a moving average, would it be better to recalculate and adjust my stop loss on the previous bar's close price, or do people generally do it in real time for each incoming tick. I know a lot of EAs tend to wait for a new bar before executing a buy or sell on a given signal, but I wondered whether the same practice is also wise for setting Stop losses. If I do it in real time for each tick, it seems less stable to me and more prone to whipsaw..

Any thoughts ?

1) Depends on the Strategy.

2) I prefer "upon bar opening". Less prone to whipsaws. Less prone to re-painting ... what you see would be what happened.

 
avatar
39
idh 2014.01.01 12:27 #
 
ubzen:

1) Depends on the Strategy.

2) I prefer "upon bar opening". Less prone to whipsaws. Less prone to re-painting ... what you see would be what happened.


thanks - you mean execute upon new bar opening but looking back at the previous bar, yes?
avatar
Moderator
3854
ubzen 2014.01.01 13:21 #
 
idh: thanks - you mean execute upon new bar opening but looking back at the previous bar, yes?

Yes, same idea as bar_close_price (in most cases).

I just word it that way because you cannot tell when the bar_close until another opens.

You can also use the new_bar open_price because it doesn't change during the life of the bar.

Back to topics list  

To add comments, please log in or register