Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Open trade on tick-by-tick basis
 Post subject: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Wed 28 Mar, 2012, 17:35 

User rating: 0
Joined: Tue 20 Mar, 2012, 12:49
Posts: 7
Location: Greece, Athens
.In the following strategy, even after the condtions are met, the trade opens at the end of the bar. I want the trade to open instantly as soon as the conditions are met on a tick-by-tick basis. Please help..

I will be really grateful if you could code it in the strategy. Thanxxx..


Attachments:
ADXStrat.java [14.12 KiB]
Downloaded 284 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: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Wed 28 Mar, 2012, 19:31 

User rating: 4
Joined: Mon 19 Sep, 2011, 09:55
Posts: 29
Location: Germany,
Obviously, if you want your strategy to work tick-by-tick then you have to check for trade condition in onTick(), instead of onBar(); onBar() is called only when a bar is finished..


 
 Post subject: Re: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Wed 28 Mar, 2012, 20:11 

User rating: 0
Joined: Tue 20 Mar, 2012, 12:49
Posts: 7
Location: Greece, Athens
I am sorry but I am new to java trading.. i don't know how to do it.. :(
But I am still learning.. Can you help or suggest something more?


 
 Post subject: Re: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Wed 28 Mar, 2012, 22:49 

User rating: 4
Joined: Mon 19 Sep, 2011, 09:55
Posts: 29
Location: Germany,
Changing the frequency (from bar to tick) may make it necessary to alter the whole strategy logic, since as long as a bar is formed its values (high, low, close) may fluctuate a lot and trigger several open/close operations on orders, which may not make a lot of sense with the particular strategy.

So, if you can not code then the whole strategy thing does not make a lot of sense, anyway.

But you can try this: move the code from onBar to onTick (except the first if statement), and substitute history.getStartTimeOfCurrentBar(instrument, selectedPeriod) for every askBar.getTime()


 
 Post subject: Re: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Thu 29 Mar, 2012, 14:40 

User rating: 0
Joined: Tue 20 Mar, 2012, 12:49
Posts: 7
Location: Greece, Athens
I request someone from jforex support to help me.. :)
Thanxxx...


 
 Post subject: Re: Open trade on tick-by-tick basis Post rating: 0   New post Posted: Thu 29 Mar, 2012, 15:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Praxieyoman wrote:
I request someone from jforex support to help me.. :)
Thanxxx...
Please specify what additional assistance do you require?


 

Jump to:  

cron
  © 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