Topic: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

It would be really great if it would be possible to use Closing Logics like the Trailing Stop along with Indicators for closing logic. Currently one can only use for example the Trailing Stop as an exit logic OR several indicators (like ADX crosses under 20). BOTH TOGETHER would be really nice, so one could have a Trailing Stop a Take Profit, a ATR Stop and a "ADX crosses under 20" as closing logics. Currently they don´t seem to work together, whyever that is. In other platforms, like Tradestation, this is not a problem at all.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

Agree with geektrader, FSB lacks this option.

This has been added to To-Do list of suggestions. I will run sticky and will update it with all your suggestions, Mr Popov will decide what to implement when he is back from the trip.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

I strongly agree!
I wish trailing stop can be set more detail, like "profit drawdown detector".
What I think is like this.

You set 2 parameters, [Minimum Profit __pips/dollars] & [Trailing Take Profit  Drawdown __%]
After your profit reach the amount of [Minimum Profit], your [Trailing Take Profit ] will be triggered.

For example if you set;
    [Minimum Profit]                         50pips
    [Trailing Take Profit] drawdown 20%

After your floating profit become over 50pips, then trailing stop will be set & take profit from 20% below from your maximum profit.
If your floating profit increase, then the trailing point will be set higher automatically. That means all the time you will get 80% of the profit from the maximum.

So in this case if your floating profit increases up to 100pips & starts falling down. Then when it hit 20% below from the max profit, close the position & take profit, 80pips.

If your floating profit is less than the amount you set (in this case 50pips), the trailing stop function will not work.

----------
If FSB & FST have such function, it will be great smile
Is it possible?

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

I'd like to request some way to expose whether there is an open position to the closing logic. Then I would be able to to code my own trailing stop indicator.
Currently, I think this could be worked around by coding the entire strategy into a trailing stop indicator so it could figure out the open position details in parallel with FSB. I haven't tried this though because it would be difficult to code, then a very difficult to maintain over different strategies.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

Hi krog,

I need your help. smile
Is it possible to help me to code my idea to FSB indicator?
Actually I made it on excel sheet but I don't know why I can't upload it here (maybe we can upload image only).
The idea is the same as I explained above.
After the floating profit reaches the value you set, indicator will check the % of draw-down from Max floating profit. If the draw-down reaches the percent you set, send the signal to close the position.

I think this is quite simple but effective. If you make it as normal indicator, you can use it together with other indicators for closing logic.
In this excel sheet, I used the Close Price, but it's better to use the current price actually, so that we can protect the profit quickly.

http://s1.postimage.org/bnYaJ.jpg

6 (edited by krog 2010-07-30 23:36:02)

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

After you type your post, hit "Preview" button, not "Submit" button. Then, under the text field, you will have a control for Attachments to attach the Excel sheet.
I think I understand your idea. Keep track of the floating profit, and if it goes down from peak floating profit by some % (looks like 35% in your screenshot), then close the position. It is like Trailing Stop on the positive Profit, not the price.

Ex, if floating PL over several bars went like:
0 - 3 - 10 - 27 - 59 - 92 - 100  // no close signal, because floating PL never went down
100 - 95 - 98 - 80 - 79 - 92 - 100 // no close signal, because 80 is only draw down of 20%
100 - 92 - 80 - 85 - 72 - 66 - 63 // close signal because 63 is floating PL draw down of 37%

This would have to be on Close if you want to use it with other closing indicators. I think FSB allows only 1 Close logic slot; but if you set that to "Bar Closing", then you can add more closing logic slots.
I don't think this will work because there is no way to tell when a position is opened, or if it is open. So, the closing indicator would not be able to know about the Floating PL. But I'll try something over the weekend to see if there may be some way to make this work.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

Hi krog,
Thank you for your instruction for attachment  smile
In this excel sheet, I didn't calculate "real" max floating profit. To calculate the real max floating profit, we need to use High for long & Low for short. But I simply used the value from the data of FSB to make simple sample.

Ya, you understand my points exactly.
Yes, I agree with you. It is easy to make it on excel sheet, if we can take in the live data to excel. But FSB custom indicator has some limitation & we cannot know when the position is opened & cannot know the floating profit. Maybe only Mr. Popov can settle this matter.
Ya, I forgot about Bar Closing. There will be good point & bad point to use Close value, because sometimes price goes up & down suddenly with in 1 bar especially on the time of announcement of GDP etc, then if you wait until the end of the bar, your fruits might be gone already. Maybe if there is an option to use Close (in this case we can use together with other indicators if the logical groups will be valid on FST) or Current value (in this case bar closing only), then it'll be nicer.

Thank you very much for helping & spending your time smile

Post's attachments

Profit_Protect_Indicator_Draft.xls 77.5 kb, 22 downloads since 2010-07-31 

You don't have the permssions to download the attachments of this post.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

Sorry -- I had no luck. On this thread, Mr Popov states:

Popov wrote:

All indicators that depend on the current position are implemented in the backtesting algorithm.
The reason is exactly the same you mention above - position info.
It's not possible to customize it for FSB.

In FSB, Stop Limit sends the stop / limit levels to the expert. If you want to customize something, it can be done in the expert.

http://forexsb.com/forum/topic/1453/how … top-limit/
I tried a couple of workarounds to see if I could get the account balance or floating PL, but was not able to. Looking at the indicators, I think FSB gets the open and close signals first, then goes back and figures out the account, floating PL, profit and loss values. This info is not available to the custom indicator.
Mr Popov mentions the "expert", which would be the next place to try to implement this. But, I don't know how to do this. Also, if this is possible, you would be able to do it in FSTrader with MT4, but not in FSBuilder, so you would not be able to backtest it first.
As for my workaround of putting all of the strategy into the closing indicator to manually track the floating PL, I don't think this is a good idea. There would be many details and so a high probability of bugs and errors. Then, you would need a new trailing limit custom indicator for every strategy.

There is Account Percent Stop, which sets the stop based on a % of the account balance. If this could be set to Floating PL, with a couple of parameters, it might work. This would be for Mr Popov to put into FSB though.

Re: Trailing Stop / Take Profit / Stop Loss along with other Closing Logic

Hi krog,

Thank you for checking this matter  smile
I understand your explanation. So we (users) cannot use the information of floating profit & we cannot make the setting of trailing take-profit currently, right.
I hope Mr. Popov can give us nice trailing system in new version. If FSB & FST have this option, it'll be a very strong tool for automated trading, because closing point is quite important for automated system. Currently I just test & test on demo account but I feel that I'd better close position manually so far. Even in winning trade, it's hard to say how strong  is the current trend until when it will last. That's why I want this option  together with logical group for closing logic.
Ya, let's wait & see how Mr. Popov will look into this matter.

Thank you again for your time to study this. I could understand the limitation of the system & problems that cause bugs more deeply (because I'm blur in programming).  smile