Topic: Three Bars Swing Pattern requested by ahmedalhoseny

http://s4.postimage.org/1XQPaA.jpg

The rules are shown in the code:

for (int bar = firstBar; bar < Bars; bar++)
{
    // Long trade
    if (Close[bar - 3] < Open[bar - 3] && // Candle 1 is black
        Low[bar - 2]   < Low[bar - 3]  && // Candle 2 has lower low than candle 1
        Close[bar - 1] > Open[bar - 1] && // Candle 3 is white
        Low[bar - 1]   > Low[bar - 2]  && // Candle 3 has higher low than candle 2
        Close[bar - 1] > Open[bar - 3])   // Candle 3 closes above candle 1 open 
        longSignals[bar] = 1;
        
    // Short trade
    if (Close[bar - 3] > Open[bar - 3] && // Candle 1 is white
        High[bar - 2]  > High[bar - 3] && // Candle 2 has higher high than candle 1
        Close[bar - 1] < Open[bar - 1] && // Candle 3 is black
        High[bar - 1]  < High[bar - 2] && // Candle 3 has lower high than candle 2
        Close[bar - 1] < Open[bar - 3])   // Candle 3 closes below candle 1 open
        shortSignals[bar] = 1;
}

Possible usage:


http://s4.postimage.org/1XQU9S.jpg


EDIT
Indicator was updated on April 12, 2012 due to a bug: Indicator doesn't trade.
Please update your indicator with attached below:

Post's attachments

Three Bars Swing Pattern.cs 4.04 kb, 81 downloads since 2012-04-12 

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

2 (edited by Popov 2012-04-13 18:56:07)

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Thanks..

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Dear popov
iam confused is the best use of bar swing pattern as an indicator or opening point of entry like ross hook?


Regards

4 (edited by Popov 2012-03-31 18:57:56)

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Г-н Попов
Защо не работи в FST

EDIT Translated in English
Mr. Popov
Why it doesn't work in FST?

Re: Three Bars Swing Pattern requested by ahmedalhoseny

ducho wrote:

Г-н Попов
Защо не работи в FST

Put the indi in the FST custom indi folder!

6 (edited by Popov 2012-03-31 19:01:10)

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Той е там. Виждам го в стратегията,не съм го ограничавал с други условия,бутона за автоматична търговия е натиснат но не отваря позиции.

EDIT Translated in English
It is there. I see it in the strategy, I was not limited it with other conditions, the Trade button is activated but the strategy doesn't open positions.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Does FST work correctly if other indis are used?

Does it fail to open any position or it just misses some trades?

8 (edited by Popov 2012-03-31 19:00:55)

Re: Three Bars Swing Pattern requested by ahmedalhoseny

FST работи добре с други индикатори. С този не отваря никакви позиции.
В страничната лента излиза инфо за отваряне но едва в края на бара в чиито начало е трябвало да бъдат отворени.

EDIT Translated in English
FST works with other indicators. With this indicator it doesn't open positions.
I side info link there is info for opening a new position but at the end of the bar. The position must be opened at the beginning at the same bar.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

I will look into this indi, live test probably next week.

If I fail to correct the indi, you will have to wait the author Mr. Popov to return.

Thanks!

Re: Three Bars Swing Pattern requested by ahmedalhoseny

This indi has a fault, it didn't do trades on my FST also. The author should look into this indi.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Dear footon

I think this type of indicators will work if it is non directional indicator i.e the action take by other indicators




Do you  or krog or any one here  know to modify the indicator to make it indirectional  indicator like inside bar or bar range indicators


Regards

Re: Three Bars Swing Pattern requested by ahmedalhoseny

ahmedalhoseny wrote:

Dear footon

I think this type of indicators will work if it is non directional indicator i.e the action take by other indicators




Do you  or krog or any one here  know to modify the indicator to make it indirectional  indicator like inside bar or bar range indicators


Regards

You mean both cases, patterns should allow long and short at the same time? I think it should be possible.

Still I don't understand why it failed live trading, code seems fine,  but debugging isn't my strong side. It's possible that after the modification it still won't work, maybe we should wait for Miroslav to come back, not a long wait anymore.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

footon wrote:

You mean both cases, patterns should allow long and short at the same time? I think it should be possible.

I think it will be some how hard  , to allow both long and short for a pattern  its ok  but if you noticed they are two different patterns not only one    if you have any idea how that be happen it will be fantastic


regards

Re: Three Bars Swing Pattern requested by ahmedalhoseny

I've done it, attachments not working so I'll email it then.

But still the main issue remains, code is fine, but in FST it does not trade. To me code seems fine, so there might be an issue with FST if these type of indis are involved.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Hi Foton,
could you post now the new version? Any luck with tracking the issue with FST ?

16 (edited by footon 2012-04-13 11:39:21)

Re: Three Bars Swing Pattern requested by ahmedalhoseny

acerguest wrote:

Hi Foton,
could you post now the new version? Any luck with tracking the issue with FST ?

Hey,

Certainly I can post it now smile please find it below. It's not actually a "new" version, just a simple modification so that it's unidirectional as Ahmed requested.

Post's attachments

Unidirectional Three Bars Swing Pattern.cs 4.04 kb, 30 downloads since 2012-04-13 

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

Re: Three Bars Swing Pattern requested by ahmedalhoseny

If I put this new indicator in FSB it fails to open any position at all.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

SpiderMan wrote:

If I put this new indicator in FSB it fails to open any position at all.

It is unidirectional, that's the modification. Look at the indi screen - if there's a signal, it says "yes" on both long and short occasions. So, in order it to open positions, another indi is needed. If you wonder why this sort of mod was made, then please ask Ahmed, it was his idea and request - I only carried it out.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

O.K. I see. I will stick on generate for a while and see what I get.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

SpiderMan wrote:

O.K. I see. I will stick on generate for a while and see what I get.

It shows promise!

Strategy name: EURUSD15minThreeBarSwing
Forex Strategy Builder v2.68.0.0
Exported on: 30/03/2012 9:41:30 AM

Description:
   None.

Market: EURUSD 15 Minutes
Spread in pips: 20.00
Swap Long in pips: -0.10
Swap Short in pips: -0.10
Commission per lot at opening and closing in pips: 0.00
Slippage in pips: 10

Maximum open lots: 20.00
Entry lots: 1.00

Intrabar scanning: Not accomplished
Interpolation method: Pessimistic scenario
Ambiguous bars: 0
Tested bars: 19800
Balance: 9659 pips (19658.80 USD)
Minimum account: -252 pips (9748.00 USD)
Maximum drawdown: 664 pips (664.00 USD)
Time in position: 8 %

[Strategy Properties]
     A same direction signal - Does nothing
     An opposite direction signal - Closes the position
     Permanent Stop Loss - None
     Permanent Take Profit - 345
     Break Even - None

[Opening Point of the Position]
     Bar Opening
     Enter the market at the beginning of the bar
     Base price  -  Open

[Opening Logic Condition]
     Unidirectional Three Bars Swing
     [All]   Three bars swing pattern

[Opening Logic Condition]
     Moving Average
     [ A ]   The bar opens above the Moving Average after opening below it
     Smoothing method  -  Simple
     Base price  -  Close
     Period  -  128
     Shift  -  70
     Use previous bar value  -  Yes

[Closing Point of the Position]
     Day Closing
     Exit the market at the end of the day
     Base price  -  Close

[Closing Logic Condition]
     Fishy Turbo
     [ a ]   The Fishy Turbo rises
     Smoothing method  -  Weighted
     Base price  -  Typical
     Smoothing period  -  52
     Level  -  0.00
     Oscillating Period  -  29
     Use previous bar value  -  No

http://img28.imageshack.us/img28/1055/snap20120330093717001.png

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Indicator was updated on April 12, 2012 due to a bug: Indicator doesn't trade.
Please update your indicator with attached to the first post.

Re: Three Bars Swing Pattern requested by ahmedalhoseny

Popov wrote:

Indicator was updated on April 12, 2012 due to a bug: Indicator doesn't trade.
Please update your indicator with attached to the first post.

Can I ask what was the bug?

Re: Three Bars Swing Pattern requested by ahmedalhoseny

//Old Code
for (int iBar = 4; iBar < Bars - 1; iBar++)

// New Code
for (int bar = firstBar; bar < Bars; bar++)

In old code, iBar doesn't reach curent bar Bars-1 and the signals are always late with one bar.
iBar < Bars - 1 vs  bar < Bars

Re: Three Bars Swing Pattern requested by ahmedalhoseny

footon wrote:
acerguest wrote:

Hi Foton,
could you post now the new version? Any luck with tracking the issue with FST ?

Hey,

Certainly I can post it now smile please find it below. It's not actually a "new" version, just a simple modification so that it's unidirectional as Ahmed requested.

About the trading issue - unfortunately still not resolved, I'm just planning to test these types of indis to see whether it is indicator or general FST problem. I suspect the latter, in both cases developer assistance is needed.

Footon, does this change affect your universal version?

Re: Three Bars Swing Pattern requested by ahmedalhoseny

SpiderMan wrote:

Footon, does this change affect your universal version?

Yes, same bug confirmed in my version too! Sorry for that!

Find corrected indi below.

Post's attachments

Unidirectional Three Bars Swing Pattern.cs 4.04 kb, 63 downloads since 2012-04-13 

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