Dukascopy
 
 
Wiki JStore Search Login

OnTick and onCandle simultaneously
 Post subject: OnTick and onCandle simultaneously Post rating: 0   Post Posted: Fri 23 Sep, 2016, 05:02 
User avatar

User rating: 0
Joined: Tue 12 Apr, 2016, 06:51
Posts: 11
Location: CanadaCanada
Hi there,

I was wondering if it's possible to have logic running under both running simultaneously. For example the following scenario,

onTick:

counter variable which is incremented by one every time a tick occurs or if certain conditions are met for a tick

and, onCandle:

manipulates or resets the counter variable every time a new candle opens or closes for whatever time period that candle is.

Please let me know if that logic is possible in vjforex or not.

Cheers!


 
 Post subject: Re: OnTick and onCandle simultaneously Post rating: 1   Post Posted: Fri 23 Sep, 2016, 08:08 
Visual JForex expert at Dukascopy
User avatar

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

This looks to be consistent and can be implemented in Visual Jforex. Generally speaking, the use of more than a single start point is possible, some ideas requires even all the start points.

Cheers


 
 Post subject: Re: OnTick and onCandle simultaneously Post rating: 0   Post Posted: Sun 02 Oct, 2016, 19:20 
User avatar

User rating: 0
Joined: Tue 12 Apr, 2016, 06:51
Posts: 11
Location: CanadaCanada
Thanks Amine.

I am having a hard time with this. I have attached an example of what I am trying to do for critique.

The basic idea is that I want onTick to check for certain conditions with every tick,

if a condition is met then a counter is incremented by 1

I then want the onCandle start point to reset these counters with every new candle (of varying candle periods which can be controlled in parameters). In the attached example, the counters would be reset with every 5 minute new candle.

Does this work? I have been trying something like this without success. It seems that the counters keep getting reset and no trades are taken.

(I didn't add this to the attached example but a simple trading logic would be something like if bidcounter>10 open a buy order, so essentially it would have to reach 10 within 5 minutes for the trade to be taken, otherwise it gets reset with the new candle).

Am I missing something?

Cheers,
Sam.


Attachments:
example.vfs [23.18 KiB]
Downloaded 194 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.
 
The Best Answer  Post subject: Re: OnTick and onCandle simultaneously Post rating: 1   Post Posted: Mon 03 Oct, 2016, 09:30 
Visual JForex expert at Dukascopy
User avatar

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

Your strategy built is fine and make sense. The only minor mistake is at the level of the instrument subscription: You have to filter Canlde period based on yout default period otherwise (your current situation) you'll have a reset every minimum candle period (10seconds)

Image


Attachments:
InstrSub.PNG [45.3 KiB]
Downloaded 348 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: OnTick and onCandle simultaneously Post rating: 0   Post Posted: Mon 03 Oct, 2016, 18:02 
User avatar

User rating: 0
Joined: Tue 12 Apr, 2016, 06:51
Posts: 11
Location: CanadaCanada
That worked.

Thanks Amine!


 

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