forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Technical Indicators → Indicator to close trade after x bars?

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 7

Topic: Indicator to close trade after x bars?

Hi all,

I am wondering if there is an indicator that I can use to close a trade a certain number of bars after opening.  Has anyone done this? I am trying to use this time-based stop for my scalping system.

Perhaps there is some way to do this with existing indicators in FST that I am not aware of?

Thank you for your help!

-Jericho

Re: Indicator to close trade after x bars?

I appologize, I see there is another thread on this subject already on the forum, and the issue seems unresolved.

Has anyone found a workaround yet?

Thanks, and happy trading!

-Jericho

Re: Indicator to close trade after x bars?

I am wondering if there is an indicator that I can use to close a trade a certain number of bars after opening.

Unfortunately, this simple logic cannot be implemented easily in FSB and FST. The reason for that is that the indicators can use information only from the market data - time, price and volume. An indicator doesn't have access to account data including positions and orders. Therefore, there is no way for an indicator to know when or at what price a position is open.

However, this idea is not completely impossible for implementation for FST. Someone can add this option in the expert advisor - MT4-FST Expert.mql. A function written in the expert have full access to all info, including currently open position and the time - when they was opened. So that will not be difficult for a programmer to write a short script that checks the current bar or tick time and to close it, if it is necessary.

Re: Indicator to close trade after x bars?

Ok, thanks Popov!
In the meantime I will find some other way of closing my trades.

Re: Indicator to close trade after x bars?

For an experiment one time, I made a custom "super" indicator to exit based on an open position. It included all the indicators in my strategy, and would simulate the entry signal to figure out the bar a position was entered. But it was a a lot of work -- the super indicator was quite long, and the parameter values had to be changed in the code and the super indicator reloaded (the parameter dialog window did not have enough controls for all the parameters of several indicators). I tested in FSB (but not FST), and seemed to match the entry, and the exiting seemed to match fairly close to expected. So I think it may be possible for backtesting, but it's fairly tough and would require some testing to be confident.

Re: Indicator to close trade after x bars?

Hi Popov,

I was thinking...
Is it not possible to somehow hold a record of when trades are opened by FST within the FST program?
If the position is opened by FST, it seems that this should be possible, and this approach should eliminate the necessity of getting this information from the Metatrader platform...Just an idea.

Thanks for your awesome software!

Jericho

Re: Indicator to close trade after x bars?

Is it not possible to somehow hold a record of when trades are opened by FST within the FST program?

It is possible as you correctly noted - inside the program. This feature must be integrated in FSB / FST as Trailing Stop, Stop Loss and Take Profit indicators are. We'll probably add it in the future releases.

Posts: 7

Pages 1

You must login or register to post a reply

Forex Software → Technical Indicators → Indicator to close trade after x bars?

Similar topics in this forum