Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Candle Shape
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=146&t=55445
Page 1 of 1

Author:  Oli [ Wed 23 Aug, 2017, 00:04 ]
Post subject:  Candle Shape

Hello JF Support Team

I'm new here and I would like to know how to:

Setup a strategy based on the shape of the last candle.
For example trigger a buy order when last candle matches following settings:

Body: Bullish (green), body size: min. 1 pip and max. 3 pips
Nose: Max. 1 pip
Tail: Min: 6 pips and max. 20 pips

I can't figure out what block to use and what settings to make..
Couldn't find any answer in the documentation or in the forum topics.
Or did I miss it?

Anyway. Help is much appreciated.

Cheers :)
Oli

Author:  amine_chourou [ Mon 28 Aug, 2017, 15:19 ]
Post subject:  Re: Candle Shape

Hi there,

There several examples in this forum dealing with candle's pattern identification (Pin bar / Hammer / etc...)
Check this for instance: https://www.dukascopy.com/swiss/english ... dle#p85454

Let me know if you have more questions

Author:  Oli [ Tue 29 Aug, 2017, 19:12 ]
Post subject:  Re: Candle Shape

Thank you Amine

This example makes things clearer.

But I still don't really understand how to set the candle parameter.
For example if I would like the bullish PinBar to have a Body Size of minimum 1 Pip and maximum 4 Pips.
Where can I enter this Pip-values? In the code itself or in the variable-box on the visual-platform?

And how to do it... If you could give me another example it would be great.

Thank you for your help. :)

Oli

Author:  amine_chourou [ Thu 31 Aug, 2017, 13:15 ]
Post subject:  Re: Candle Shape

Hi there,

Attached an example with some notes. The strategy will trade at the open price of the candle that follows the pin bar one. I've considered your spec in the first post but modified the tail size cause 6-20 pips was too restrictive so I used 4-20 for testing purpose. Feel free to adjust as per your needs.



Image

Attachments:
PinBar.vfs [35.25 KiB]
Downloaded 190 times
PinBar.JPG [59.66 KiB]
Downloaded 498 times

Author:  Oli [ Thu 31 Aug, 2017, 16:19 ]
Post subject:  Re: Candle Shape

Hello Amine

Great explanation. Thank you so much!

Now I understand how to set the pip sizes. :idea:

Cheers

Oli

Author:  Oli [ Mon 04 Sep, 2017, 17:39 ]
Post subject:  Re: Candle Shape

Hello Amine

I have another question for you.

I would like to combine the 2 strategies in the attachments.

Result should be:

3 Red Candles followed by Green PinBar > Buy Order

So far I understand the architecture of both strategies.. but I can not combine them.
I tried many variations without success. But I am pretty sure you know how to do it.
Please give me a hint. :)

Thank you.
Oli

Attachments:
PinBarNew.vfs [36.44 KiB]
Downloaded 224 times
threeRedCandlesSellHistoricalCandle.vfs [30.99 KiB]
Downloaded 219 times

Author:  Oli [ Thu 07 Sep, 2017, 19:13 ]
Post subject:  Re: Candle Shape

Hi there,

Any idea how to handle my "problem" ?

Cheers
Oli

Author:  foreignexchange [ Tue 12 Sep, 2017, 09:40 ]
Post subject:  Re: Candle Shape

You could try to code the SELL ;)

Good trading

Attachments:
Bearish3_pattern_Buy.vfs [43.95 KiB]
Downloaded 224 times

Author:  Oli [ Thu 14 Sep, 2017, 09:01 ]
Post subject:  Re: Candle Shape

Hi there

I did the SELL but not without a "cheat sheet" so far. :)
I start to understand the logic and the possibilities of JF.

This is really a great Strategy Builder !

I have another question.. Please check the notes in the attachment.

Thank you very much :D

Oli

Attachments:
File comment: PB Strategy
TEST_Red3_GreenPB_Buy.vfs [52.93 KiB]
Downloaded 234 times

Author:  amine_chourou [ Tue 19 Sep, 2017, 16:04 ]
Post subject:  Re: Candle Shape

Hey

Sorry for the late answer .. I'm back :)
You should try with 3 blocks of "Get historical candle" with shifts 1, 2, 3 respectively (for your 3 red candles ) and one dedicated block for the green then duplicate the overall architecture and you'll get it !

Author:  Oli [ Fri 22 Sep, 2017, 09:17 ]
Post subject:  Re: Candle Shape

Hi

No problem. Thanks for the hint. ;)
I could do it. It works very well so far.

Cheers

Oli

Author:  Oli [ Mon 25 Sep, 2017, 15:30 ]
Post subject:  Re: Candle Shape

Hey Amine

How can I combine my current candlestick pattern strategy with a MA-crossing?

Please have a look at it and advise.

Cheers :)
Oli

Also sent you a PM about this.. Thanks.

Attachments:
JF_Strategy_PINBAR_Trigger.vfs [64.4 KiB]
Downloaded 212 times

Author:  amine_chourou [ Wed 27 Sep, 2017, 16:26 ]
Post subject:  Re: Candle Shape

Hi there !

It looks like trades are pushed with your current version:


Image

Is this not matching your expectations ? How ? Can you show on a chart your entry conditions in details ?

Thanks !

Attachments:
pinBar_trigger.JPG [157.09 KiB]
Downloaded 463 times

Author:  Oli [ Thu 28 Sep, 2017, 04:58 ]
Post subject:  Re: Candle Shape

Hi there,

Yes the trades are pushed. Everything works just fine.

I just need a few more extensions to the current strategy. (I did send them to you by PM a few days ago)

The candlestick setup should appear right after the EMA-crossing like on this picure here..
Image

Attachments:
JF Strategy.jpg [122.03 KiB]
Downloaded 447 times

Author:  Oli [ Thu 28 Sep, 2017, 05:05 ]
Post subject:  Re: Candle Shape

I did add the EMA-crossing structure into the current strategy architecture.
But somehow it is not combining it. I must have connected the blocks the wrong way. (please have a look at the attached .vfs file)
Can you please show me how to connect it the right way?

Thanks a lot.

Oli

Attachments:
JF_Strategy_PINBAR_Trigger.vfs [64.4 KiB]
Downloaded 211 times

Author:  Oli [ Tue 03 Oct, 2017, 02:06 ]
Post subject:  Re: Candle Shape

I still could not figure out a way to combine the blocks. :?

Anybody here knows how to do it?

Cheers :)

Author:  amine_chourou [ Wed 04 Oct, 2017, 09:07 ]
Post subject:  Re: Candle Shape

Hi there,

I restarted your strategy from scratch with a another implementation method:
- We'll do a look-back for the 10 previous candles to check your entry conditions (green candles + red + cross)
- I used a loop viewer in order to accelerate this, so every execution flow we'll have a check for the previous 10 candles

The problem is:
I don't see positions created, (although I did not test thoroughly) It seems to me that the entry conditions are too restrictive so if you can test this and / or point out on the historical tester a case where the strategy should push a trade , this would help a lot.


Cheers

Attachments:
Oli_V2.vfs [54.96 KiB]
Downloaded 209 times

Author:  amine_chourou [ Thu 05 Oct, 2017, 08:46 ]
Post subject:  Re: Candle Shape

Hi again,

I found an error in the previous example and the idea of using the loop is not implemented the right way. I'll think about it but as an alternative solution, I've attached another example but I used the classic way with Get historical candle / shifts.
Image

Some testing and fine-tuning is required.

Attachments:
V4.JPG [41.41 KiB]
Downloaded 438 times
Oli_V4.vfs [57.38 KiB]
Downloaded 197 times

Author:  Oli [ Fri 06 Oct, 2017, 11:23 ]
Post subject:  Re: Candle Shape

Hi there

I reduced the EMA's size a bit and the trades are triggered the right way so far.
I will test it some more.

Well done! :D

Cheers

Author:  amine_chourou [ Tue 10 Oct, 2017, 11:54 ]
Post subject:  Re: Candle Shape

Good to hear that !

  Page 1 of 1