Dukascopy
 
 
Wiki JStore Search Login

candle high and low calculation
 Post subject: candle high and low calculation Post rating: 0   Post Posted: Tue 20 May, 2014, 13:29 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Hi,

Can i know how to create a logic for IF last bid > (last bid candle high+last bid candle low)/2 then BUY ?

thank you very much


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Tue 20 May, 2014, 14:46 
Visual JForex expert at Dukascopy
User avatar

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

This is basically what you described, assuming:
- 10mn candles (as we're talking about highs and lows)
- SL, TP set by default
- No limitation made on the number of open positions as not specified.

Fell free to elaborate and adapt your strategy based on this example.

Cheers


Attachments:
Sample.vfs [24.23 KiB]
Downloaded 178 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: candle high and low calculation Post rating: 0   Post Posted: Wed 21 May, 2014, 09:22 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Hi there,

thanks for your prompt reply.

I have built a program but i can't run it as it appears "strategy error" when I run it

Attached herewith my file, can you please help?

thank you very much.
chia


Attachments:
ky1.vfs [31.31 KiB]
Downloaded 163 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: candle high and low calculation Post rating: 0   Post Posted: Wed 21 May, 2014, 09:59 
Visual JForex expert at Dukascopy
User avatar

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

The main reason why this error pop up is the unfilled first block which is highlighted with a red title bar color (GetTimeUnit block). In general, this error happens in case of incomplete condition -i.e block- which is read by the system and generates the error.
Beyond that, your if condition with the variable m7 doesn't make sens as you're saying that IF m7=m7 (assuming m7=7) <=> IF 7=7 then ... which is always the case therefore this condition is always verified. What did you meant by this ? don't hesitate to explain in details your idea so that we get a clear picture, the more the better ...
Please pay attention to the blocks exit points as each one has a specific function: Running the mouse over it will produce a tool-tip which displays a short description of the flow.

Also, feel free to check VJF topics sorted by themes as they may give you valuable information.

Thx


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Wed 21 May, 2014, 11:10 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
hi there,

Thanks again for your prompt reply.

My idea is as below:

Candle period : 15 minute
stop loss : 5 pips

Sell market if the conditions below met:
1) Hourly at minute of 7 e.g. on 0107, 0207, 0307 etc
2) last tick < last candle high
3) last tick >= last candle length/2

To close open position based on conditions below:
1) Hourly at minute of 7 e.g. on 0107, 0207, 0307 etc
2) last tick > last candle low

Attached is my work trying to implement the above idea but it doesn't seem working.

can you please help? Thank you very much.

Best regards,
chia


Attachments:
ky1.vfs [31.94 KiB]
Downloaded 156 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: candle high and low calculation Post rating: 0   Post Posted: Thu 22 May, 2014, 09:03 
Visual JForex expert at Dukascopy
User avatar

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

Please check the attached strategy that cope with your specifications.
Also, please note that if you want to trade based in minutes period, it is useless to subsicribe on 15mn candle as you're not using this variable anywhere which is the main reason why I made the default period = 1mn.

any comment is welcome.

A


Attachments:
M7.vfs [31.94 KiB]
Downloaded 172 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: candle high and low calculation Post rating: 0   Post Posted: Thu 22 May, 2014, 14:56 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Hi A,

Thank you very much for your help, I'm deeply appreciate it.

Btw, can you explain more about why the 15mins candle period subscription is useless?As I'm making the buy/sell decisions based on the 15 mins candle bar.

thanks & best regards
chia


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Thu 22 May, 2014, 17:04 
Visual JForex expert at Dukascopy
User avatar

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

Sorry, mea culpa :)
I missed a point in your upper description and therefore I updated the strategy/

Thanks


Attachments:
M7_1.vfs [30.48 KiB]
Downloaded 163 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: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 05:22 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Hi A,

Thank you very much for your help again.

I am trying to run the created strategy in my demo account but it doesn't appear in the visual forex folder.

Attached is the image where it shows empty in the folder.

Can you please advise? thank you in advance.

Best regards,
chia


Attachments:
vfx.doc [386.5 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: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 09:53 
Visual JForex expert at Dukascopy
User avatar

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

Kindly make sure your strategy is built under Visual before attempting to open it from Jforex. In case the strategy was already built, it could be a connection issue: try to re login in both platforms and in case you're still getting the same issue then send us the Java console output.
How to enable Java console : https://www.java.com/en/download/help/javaconsole.xml

Cheers


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 10:27 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Hi A,

I've built the strategy in vfx and is make sure the both platforms signed in but still no avail.

Below is the java console for your kind attention.

Thanks and regards,
chia


Java Web Start 10.55.2.14
Using JRE version 1.7.0_55-b14 Java HotSpot(TM) Client VM
User home directory = C:\Users\User
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[https://crl.thawte.com/ThawtePremiumServerCA.crl]: updateAvailable=true,lastModified=Mon May 26 05:15:34 SGT 2014,length=19276
2014-05-26 17:51:45.532 ERROR Ping - Ping to [d-ja-gva-91-191.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:261)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:45.536 ERROR Ping - Ping to [d-ja-gva-91-191.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:262)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:45.537 ERROR Ping - Ping to [d-ja-gva-91-191.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:263)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:45.538 ERROR Ping - Ping to [d-ja-usa-e-97-4-b.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:261)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:45.538 ERROR Ping - Ping to [d-ja-usa-e-97-4-b.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:262)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:45.539 ERROR Ping - Ping to [d-ja-usa-e-97-4-b.dukascopy.com:10443] failed: null
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at com.dukascopy.api.impl.connect.Ping$Connector.add(Ping.java:133)
at com.dukascopy.api.impl.connect.Ping.ping(Ping.java:263)
at com.dukascopy.api.impl.connect.AuthorizationClient.selectFastest(AuthorizationClient.java:434)
at com.dukascopy.api.impl.connect.AuthorizationClient.getUrlAndTicket(AuthorizationClient.java:177)
at com.dukascopy.api.impl.connect.DCClientImpl.authenticate(DCClientImpl.java:467)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:242)
at com.dukascopy.api.impl.connect.DCClientImpl.connect(DCClientImpl.java:232)
at com.dukascopy.vfruntime.Launcher.a(Unknown Source)
at com.dukascopy.vfruntime.login.b.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014-05-26 17:51:50.598 WARN WLabelData - White Label Image is not received
May 26, 2014 5:51:53 PM org.xsocket.connection.Server$LifeCycleHandler onConnected
INFO: server listening on 0:0:0:0:0:0:0:0:9090 (xSocket 2.8.15)


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 15:00 
Visual JForex expert at Dukascopy
User avatar

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

Does your Jforex account is linked to community account ?
From Jforex > Portfolio > My Account > bottom right corner and link account

Then try to open your strategy again.

Thanks


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 15:34 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Dear A,

I've tried to login the fx community to link the account as per your instructions. However, after I have key in the username & password, it doesn't appear whether I have login successfully but it just return to the original account info page. Attached are the screen shots before and after I try to login to fx community. And as a result, I still couldn't find my strategy in Jforex.

Can you please advise?

Thanks and regards,
chia


Attachments:
after login.doc [401 KiB]
Downloaded 115 times
Link account.doc [457.5 KiB]
Downloaded 136 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: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 16:51 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Understood,
Can you please forward your request to [email protected] and we'll do the necessary.

Thanks


 
 Post subject: Re: candle high and low calculation Post rating: 0   Post Posted: Mon 26 May, 2014, 17:18 
User avatar

User rating: 0
Joined: Tue 20 May, 2014, 13:09
Posts: 15
Location: Malaysia, Kuala Lumpur
Dear A,

Thank you very much for your kind assistance. I have forwarded the message to the email address you given and shall wait for the reply.

Thanks again and you have a great evening!

best regards,
chia


 

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