Dukascopy
 
 
Wiki JStore Search Login

Price differential in a time span
 Post subject: Price differential in a time span Post rating: 0   New post Posted: Wed 20 Apr, 2016, 16:33 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Hallo,

I would like in Visual JForex to develop a group of block to assign to variable the value price at the time span parameter.

I would like to do it in TICK mode (no candle!). Need new values in every tick and no every 10 second like the open (or close) of the candle!

IN EVERY TICK:

TIME = N (SECOND)

VAR RESULT = PRICE1-PRICE2



This is the img concept:

Image

I accept any suggest.
Thanks in advance! :)


 
 Post subject: Re: Price differential in a time span Post rating: 0   New post Posted: Thu 21 Apr, 2016, 13:32 
Visual JForex expert at Dukascopy
User avatar

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

I see what you're looking for.
Currently the time stamp that we have in Visual Jforex is based on candles or on ticks as you can see it under ticks and candles sections (left side of the platform)
So if you don't want to work with 10 sec candles which is the shortest candle's length, your idea could be achieved using OnTick method BUT you will rely on the tick time (the time stamp corresponding to every price received). The second important thing is that your strategy will work on forward which means that in the current instant "t" the system will catch the price and time and waits for the expiry time (end of N in seconds) to catch the upcoming price and then gives your the VAR.
Here is an example with N=8 seconds : Note that the time is expressed in milliseconds here. For 3 sec --> 3*1000=3000


Attachments:
TimeVar.vfs [22.85 KiB]
Downloaded 184 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: Price differential in a time span Post rating: 0   New post Posted: Fri 22 Apr, 2016, 00:49 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Hello Amine!

Really many thanks for your reply and your appreciate suggest!

Knowing that the minimum time of the candle is 10 second, with your system you have created a virtual 8 second candle! This is great.

The problem is what happen at the price inside this 8 second? Look ...

Image


How you can see the output value in this 8 seconds is 2 pips ... really the movement is 11 pips up and 13 down but it cannot detect.

For this reason in my idea I need to work in ticks and not en candle.


FIRST PROPOSE:

The same method that you have propose but in a small time. Get the price value every little time (1 second) and compare all variables to define the maximum and the minimum.


SECOND PROPOSE:

Every tick, in a lapse of time (8 second), detect the maximum and minimum price:

Image


I know that to get the maximum and minimum maybe we need to get the value of the price in EVERY TICK but maybe is possible use some trick to do it!

I'm thinking to use some indicator to assign the pivot to a specific time and then compare with price actual... for example ZIGZAG indicator ...but in tick chart it does not detect the pivot very well.

I looking forward to search the best solution.

Many thanks for your support! :)


 
 Post subject: Re: Price differential in a time span Post rating: 0   New post Posted: Thu 05 May, 2016, 16:08 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
So in this case the requirement has changed:
You're looking now for the min max prices within a range of 8 ticks ?


 
 Post subject: Re: Price differential in a time span Post rating: 0   New post Posted: Mon 09 May, 2016, 12:08 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Dear Amine,

how you can see from my last post the problem is that if we get the price every time (8 sec) is possible to lost the fast movement or oscillations inside the range time.

I have find an idea and I have modified your vfs:

* every time (ex. 8 sec) it place two levels (high-low) to detect the mayor movements of the price in the range time.

This the variation i changed the red for blue:

Image

It work fine ;)

Many thanks for your suggest of the expiry time .. very useful.

Kind regards. Clau


 
 Post subject: Re: Price differential in a time span Post rating: 0   New post Posted: Mon 09 May, 2016, 15:08 
Visual JForex expert at Dukascopy
User avatar

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

You're welcome!
Attached another idea if you wish to get the highs and lows within the same range of time.

Enjoy !
Cheers


Attachments:
TimeVar_HighLow.vfs [26.28 KiB]
Downloaded 152 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: Price differential in a time span Post rating: 0   New post Posted: Mon 09 May, 2016, 15:56 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Hello... sorry Amine, I do not understand your last.. :?: Could you explain me.. :oops:

Look:

STEP1: you give high and low values to variables
STEP2: compare price with values (high-low) ...but this comparison always will be true ...so what is the use?
STEP3. assign last bit (the price) to high and low variables (how can I use them?)

Many thanks for your support! :)


Image


 
 Post subject: Re: Price differential in a time span Post rating: 0   New post Posted: Tue 10 May, 2016, 08:37 
Visual JForex expert at Dukascopy
User avatar

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

What you described below is true but in the very first cycle when the strategy starts;

Quote:
STEP1: you give high and low values to variables
STEP2: compare price with values (high-low) ...but this comparison always will be true ...so what is the use?
STEP3. assign last bit (the price) to high and low variables (how can I use them?)


So imagine the first check of the strategy, the above conditions are always verified and the high and low will get the value of the first tick price within the array of your 8 ticks. then this first price will be compared to the next tick and this next tick is higher than the previous "high" variable, it will get its value .. and so on... So at the end of the 8 ticks cycle , the strategy will compare every price with the previous one and will get the highest price and lowest price that you can use later. Once used, you can assign back 0 to the high and 10000 to the low.
the start values of 0 for the high and 10000 for the low are made so that the first IF condition get passed : 0 < last tick and 10000>last tick

you see ?


 

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