# forex software

Create and Test Forex Strategies

forex software

Forex Forum

Forex Software, Forex Strategies, Expert Advisors Generator

# logical groups

Forex Forum → logical groups

Pages 1

## Posts: 7

#### Topic: logical groups

Question on Logical Groups:

Logical groups apply AND and OR to the opening and closing logic. So, all the conditions of Open A group must be met, or Open B group must be met, to enter a position. And the same for Close a group, and Close b group.

Can I set it so a position entered by Open A group will only be exited by Close a group, and Open B group only exited by close b group? Or is the only option that Open A group be exited by Close a or Close b group (presumably whichever comes first after Open A entry), and Open B group can be exited by Close a or Close b group?
I'm hoping to specify the pair of Open-Close groups, then I could design the strategy to alternate between 2 sub-strategies.

#### Re: logical groups

krog wrote:

Question on Logical Groups:

Logical groups apply AND and OR to the opening and closing logic. So, all the conditions of Open A group must be met, or Open B group must be met, to enter a position. And the same for Close a group, and Close b group.

Can I set it so a position entered by Open A group will only be exited by Close a group, and Open B group only exited by close b group? Or is the only option that Open A group be exited by Close a or Close b group (presumably whichever comes first after Open A entry), and Open B group can be exited by Close a or Close b group?
I'm hoping to specify the pair of Open-Close groups, then I could design the strategy to alternate between 2 sub-strategies.

I think in your case - you should run 2 FST's on the same pair - 1 for logical grp A rules - 1 for logical grp B rules. When you do, just make sure the Magic number and ID is set different for each when you drag the FST EA over to your charts - (ie, 2 charts of the same pair and timeframe - 2 FST EA drag n drops). Also remember to select 2 differrent ID's and select "ALLOW RUNNING MULTIPLE FST......" under the TOOLS menu.

I don't think it's possible to do this all on the 1 FST running - but definitely somebody correct me if im wrong:)

#### Re: logical groups

Thanks for the suggestion, I hadn't thought of that. I'll try it out and advise what I find.
I also want one strategy to block the other until the position is exited, which may lead to 2 other problems I'll try to sort out:
1) how to backtest the alternating strategies in FSB; I may be able to put both sub-strategies with the alternator into a custom indicator as a workaround, or run them individually then write another app that takes the positions summaries and zips them together.
2) how to get MT4 to use only one or the other, but not enter positions from both at the same time. It may function like this already; if not, then the custom indicator workaround could solve it, or modifying the EA may be able to do it.

#### Re: logical groups

krog wrote:

Thanks for the suggestion, I hadn't thought of that. I'll try it out and advise what I find.
I also want one strategy to block the other until the position is exited, which may lead to 2 other problems I'll try to sort out:
1) how to backtest the alternating strategies in FSB; I may be able to put both sub-strategies with the alternator into a custom indicator as a workaround, or run them individually then write another app that takes the positions summaries and zips them together.
2) how to get MT4 to use only one or the other, but not enter positions from both at the same time. It may function like this already; if not, then the custom indicator workaround could solve it, or modifying the EA may be able to do it.

or...if you ask Mr Popov nicely, he might include that feature in the next version:)

#### Re: logical groups

When a closing condition (group) is satisfied, FSB / FST closes the position no matter why or what condition has opened it.  Also there is no way for the programs to recognize which group has opened that position.

However, I think you can backtest such strategy.
1. Set the first pair entry group - exit group as a separate strategy.
2. Export this strategy as a custom indicator (Tools - Custom Indicators - Export a strategy as a custom indicator). This will save the strategy signals as a static indicator and will load it in the indicators list automatically.
3. Set your second strategy and use the saved static custom indicator as an Opening logic condition but mark its Reversed signals option. In that case the new strategy will trade only when the first one doesn't.

For FST is more complicated. The expert has to be modified in order to prevent opening of a new position when a position for that symbol and period is already opened by other strategy.

#### Re: logical groups

Popov wrote:

When a closing condition (group) is satisfied, FSB / FST closes the position no matter why or what condition has opened it.  Also there is no way for the programs to recognize which group has opened that position.

I found this is what happened using soladood's suggestion of MT4: 2 charts of same pair with FST: 2 instances running both strategies. FST(A) would enter a position, then FST(B) could close it. I agree, to do this, best approach will be modifying the expert. I think this could be done by checking a close order request's magic number or connection ID. I'll try this week and advise.

Popov wrote:

However, I think you can backtest such strategy.
1. Set the first pair entry group - exit group as a separate strategy.
2. Export this strategy as a custom indicator (Tools - Custom Indicators - Export a strategy as a custom indicator). This will save the strategy signals as a static indicator and will load it in the indicators list automatically.
3. Set your second strategy and use the saved static custom indicator as an Opening logic condition but mark its Reversed signals option. In that case the new strategy will trade only when the first one doesn't.

Thanks for the suggestion -- this was close, but didn't fully get what I was looking for. I tried it out, but there were some positions from the 2 strategies that still overlapped.

I think I can figure out another way to do this. I came across an interesting idea called "Parrondo's Paradox" and was trying to research it.

#### Re: logical groups

Unfortunately, can't figure out a way to make it only Enter(A)-Exit(a) or Enter(B)-Exit(b). It doesn't seem there is any way for one indicator slot to send info to another indicator slot. If the open slots could send info to a closing slot, or if entries could mark the position as to which strategy opened it, I think it might be possible. But I could not figure this out. I'll have to request this feature for the next release.

## Posts: 7

Pages 1

Forex Forum → logical groups