Dukascopy
 
 
Wiki JStore Search Login

Newbie needs help with "Early Bird" strategy.
 Post subject: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Sun 22 Feb, 2015, 20:13 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
So i've been trying to create a basic strategy just to learn the "programming" in VJFX.

Currently i'm trying to get the "Early Bird" strategy to work, but i've hit some roadblocks and I'm really out of ideas.

I have watched the webinar on the same topic and i basically copy pasted the whole thing, but it still didn't work :/

So i tried to make my own version and tried to make it as "clear" as possible so that the computer would understand what i'm trying to acheave (probably i've put in way too many blocks), but still no success :(

Now the problem is that when the time comes to open pending orders (0800 GMT), then the strategy tester just stops.
Its like i would have programmed it to end the strategy at 0800, although i have no such block in my strategy...

I've tried absolutely everything i could think of. Tried to rearrange the connections between blocks and change the block flow order, but nothing works.

So if anyone could check my strategy for errors and point out the flaws, I would be a really happy camper :P

Thank You in advance.


Aigar88


Attachments:
File comment: Strategy stops at 0800 GMT
HelpMe.vfs [52.9 KiB]
Downloaded 159 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Sun 22 Feb, 2015, 20:28 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
OK quick update.

Just did a quick test to confirm my troubles, And

Now the strategy wont stop, but keeps on going (which is strange, because i havent made any changes to it. It just miraculously goes on now...)

But it still wont open any orders, so the problem is still there, and my question is why?


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 10:54 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi there,

You strategy is subscribed at an hourly period and therefore the flow will be executed every candle close each hour but you set a market open hour to be equal to 8 am therefore, once the candle time is triggered, your conditions will be checked only once cause the next candle time is going to be @ 9am. If you need to set a time range for London session you have to add another condition for the close session time. Also, it is useless to check both Ask and Bid times as they are exactly the same, it is sufficient to use one side.

Next issue is your open prices, I just saw that your buy stop entry is around 3.xxxx which is quite far and will be never triggered (nor shown in the chart due to the chart scale) So you have to double check this. Simply drag and drop your variable on the workspace to be able to see its value while the test is running (and once the flow reach it)

Cheers


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 12:03 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
Indeed. You're quite right about the entry buy price being too high..

Thanks for the tip about dragging the variables on the workspace (Y), its going to help a lot with debugging :)

There must be some bug in the calculations, because it is not calculating what its supposed to calculate and returns a too high answer...

maybe i have to use multiple action to get correct values for the calculations.

Also i noticed that the "loop viewer" is returning the last candle highest value and lowest value, and not the highest/lowest values of the last 8 candles.

Any suggestions about how to fix this?

Thanks.


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 12:09 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
Sorry.

Actually the "loop wiever" is only returning the HIGEST value and sets that value for all HIGH OPEN CLOSE and LOW values...

And when i change the shift to 1 on "get historical candles" then it returns the OCHL of the previous candle and not previous 8 candles...


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 13:11 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
OK.

I've now come to a conclusion that there must be a bug in the "get historical candles" block.

Ive tested only the "get historical candles" block on its own and also the method what you sent me "Highest_Lowest_1" , which should return the highest and lowest values from specified bars backward, is returning faulty values. the values are neither open, close, high, or low... They are just some random price points on chart...

Help please.

How to get correct highest, lowest, open, close values from previous 5 last candles on each new candle?


Thanks.


Attachments:
File comment: not working properly
Highest_Lowest_1.vfs [27.05 KiB]
Downloaded 142 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 14:03 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

I've attached a version of your file with some modifications made only on the first part (No changes on the calculations)
The loop viewer is an iteration function that retrieves an array of data. This array contain all the requested information BUT it won't be displayed entirely that's why you can not see all the close prices of the 8 last candles for example. The problem comes from the first period filters. For such type of needs you can work straight with get historical candle block and input your trading period and the side.

Hope this helps.


Attachments:
HelpMe_1.vfs [51.41 KiB]
Downloaded 162 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 23 Feb, 2015, 18:02 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
Alright!

Long story short:

This is what I was trying to accomplish: HI_LO_8
It looks at every candle for eight past candles and then saves the highest and lowest values of eight past candles (meaning the highest point the price hase gone during eight past candles) on variables that can be used for whatever reasons needed.

Awfully large amount of blocks for such a small task and in my opinion the "get historic candles" block should be able to do it, but it didn't, or i just havent figured out the right way of using it (with loop wiever i would presume, but didn't work).

So below is an example of what i was looking for.

Cheers!


Attachments:
HI_LO_8.vfs [49.08 KiB]
Downloaded 159 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Tue 24 Feb, 2015, 17:35 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Alright,

Please check the attached example for your consideration.
It retrieves several highs and lows as you can see from multiple set of candles defined in "Get historical candles" blocks.

Cheers!


Attachments:
Highest_Lowest_2.vfs [42.31 KiB]
Downloaded 197 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Thu 05 Mar, 2015, 07:15 
User avatar

User rating: 0
Joined: Sat 07 Feb, 2015, 04:48
Posts: 1
Location: Singapore,
amine_chourou wrote:
Alright,

Please check the attached example for your consideration.
It retrieves several highs and lows as you can see from multiple set of candles defined in "Get historical candles" blocks.

Cheers!

aigar88 wrote:
Alright!

Long story short:

This is what I was trying to accomplish: HI_LO_8
It looks at every candle for eight past candles and then saves the highest and lowest values of eight past candles (meaning the highest point the price hase gone during eight past candles) on variables that can be used for whatever reasons needed.

Awfully large amount of blocks for such a small task and in my opinion the "get historic candles" block should be able to do it, but it didn't, or i just havent figured out the right way of using it (with loop wiever i would presume, but didn't work).

So below is an example of what i was looking for.

Cheers!



Hey Guys!

This thread came in handy Yesterday when i was trying to achieve a similar concept..... (I'm also relatively new to vjfx, but I'm a quick study)

Then I realised there was a much simpler way to achieve this using the Donchian channel indicator, using the high low output values for whatever your defined period.

Much like the VFS files here, my strat opens buy and sell orders simultaneously on the London open, at various tp and sl levels depending on period range. all seems to work soundly, however what i am trying to figure out is how to close specific pending orders if the opposite pending order tp is hit.

What i want to happen....

Each day two pending orders are opened simultaneously, regardless of any existing pending orders still open, and they have not time limit. However when one of the TP's of the two each day is hit, i would like the opposite pending order to be closed (only if pending, if it was executed then let it run its course.)

Not sure if this made any sense, it does in my head haha.... Anyway i would really appreciate some examples of may how i could control and close pending orders in this fashion.

Cheers!


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Thu 12 Mar, 2015, 16:37 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 15:58
Posts: 21
Location: FinlandFinland
Hi.

Sry for the late answer..

But i think that pending orders must have a good til time entered. There's no such option as good til canceled in vjfx. But you could try to make it happen with market orders. (if price reaches a specific level then buy/sell, and if price reaches the TP level then dont buy at opposite level, but if price reverses without reaching TP price level then open a opposite order at SL price level.

Hope this made any sense :D


 
 Post subject: Re: Newbie needs help with "Early Bird" strategy. Post rating: 0   New post Posted: Mon 16 Mar, 2015, 17:15 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Quote:
Hey Guys!

This thread came in handy Yesterday when i was trying to achieve a similar concept..... (I'm also relatively new to vjfx, but I'm a quick study)

Then I realized there was a much simpler way to achieve this using the Donchian channel indicator, using the high low output values for whatever your defined period.

Much like the VFS files here, my strat opens buy and sell orders simultaneously on the London open, at various tp and sl levels depending on period range. all seems to work soundly, however what i am trying to figure out is how to close specific pending orders if the opposite pending order tp is hit.

What i want to happen....

Each day two pending orders are opened simultaneously, regardless of any existing pending orders still open, and they have not time limit. However when one of the TP's of the two each day is hit, i would like the opposite pending order to be closed (only if pending, if it was executed then let it run its course.)

Not sure if this made any sense, it does in my head haha.... Anyway i would really appreciate some examples of may how i could control and close pending orders in this fashion.

Cheers!


This is feasible:
You need to identify your Pending order by creating a dedicated 'position' variable at the level of the output of each block then once one of these orders is filled then closed with profit (you can use P&L variable to be >0 for that) then you plug a "close and Cancel Position" for the other pending order.

Let me know if you need any help and feel free to post your progress in a vfs file

Cheers


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com