|
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.
| a question about test tools |
|
zzping115
|
| Post subject: a question about test tools |
Post rating: 0
|
Posted: Wed 02 Oct, 2013, 11:40
|
|
User rating: 0
Joined: Wed 28 Mar, 2012, 06:41 Posts: 25 Location: China, Beijing
|
|
hello,erveryone, my simple stategy is below: if it was started in local run. the two positons would be opened.that was allright.but if I used the test tool to test it with history,the only "111" position was opened.waht 's wrong?what shuld I do?
public void onTick(Instrument instrument, ITick tick) throws JFException { if(engine.getOrders()==null || engine.getOrders().size()== 0){ IOrder order = engine.submitOrder("111",Instrument.EURUSD,IEngine.OrderCommand.BUY,0.01,0,3,0,0);
IOrder orderr = engine.submitOrder("222",Instrument.USDCHF,IEngine.OrderCommand.BUY,0.01,0,3,0,0); } if
|
|
|
|
|
 |
|
tcsabina
|
| Post subject: Re: a question about test tools |
Post rating: 1
|
Posted: Wed 02 Oct, 2013, 11:55
|
|
User rating: 164
Joined: Mon 08 Oct, 2012, 10:35 Posts: 676 Location: NetherlandsNetherlands
|
|
Just a tip: For the Historical Tester (if that is what you refer as test tool) you have to select what instruments the test will `run` on. There is an Instrument button on the tester (if I am not mistaken). Make sure USDCHF is selected also.
|
|
|
|
|
 |
|
zzping115
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Wed 02 Oct, 2013, 14:22
|
|
User rating: 0
Joined: Wed 28 Mar, 2012, 06:41 Posts: 25 Location: China, Beijing
|
tcsabina wrote: Just a tip: For the Historical Tester (if that is what you refer as test tool) you have to select what instruments the test will `run` on. There is an Instrument button on the tester (if I am not mistaken). Make sure USDCHF is selected also. yes ,I chose both USDCHF AND EURUSD in the instrument button.it did not work yet.
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Wed 02 Oct, 2013, 16:20
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
Please provide a full example strategy which replicates the case. Please provide a screenshot of the Historical Tester settings that you use.
|
|
|
|
|
 |
|
zzping115
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Wed 02 Oct, 2013, 17:29
|
|
User rating: 0
Joined: Wed 28 Mar, 2012, 06:41 Posts: 25 Location: China, Beijing
|
package jforex;
import java.util.*;
import com.dukascopy.api.*;
public class Strategywwww implements IStrategy { private IEngine engine; private IConsole console; private IHistory history; private IContext context; private IIndicators indicators; private IUserInterface userInterface; public void onStart(IContext context) throws JFException { this.engine = context.getEngine(); this.console = context.getConsole(); this.history = context.getHistory(); this.context = context; this.indicators = context.getIndicators(); this.userInterface = context.getUserInterface(); }
public void onAccount(IAccount account) throws JFException {
}
public void onMessage(IMessage message) throws JFException { }
public void onStop() throws JFException { }
public void onTick(Instrument instrument, ITick tick) throws JFException { if(engine.getOrders()==null || engine.getOrders().size()== 0){ IOrder order = engine.submitOrder("aaa",Instrument.EURUSD,IEngine.OrderCommand.BUY,0.01,0,3,0,0); IOrder orderr = engine.submitOrder("bbb",Instrument.USDCHF,IEngine.OrderCommand.BUY,0.01,0,3,0,0); } } public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { } }
| Attachments: |
Strategywwww_03102013_002731.rar [2.11 KiB]
Downloaded 133 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.
|
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Thu 03 Oct, 2013, 07:20
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
API Support wrote: Please provide a screenshot of the Historical Tester settings that you use.
|
|
|
|
|
 |
|
zzping115
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Thu 03 Oct, 2013, 09:04
|
|
User rating: 0
Joined: Wed 28 Mar, 2012, 06:41 Posts: 25 Location: China, Beijing
|
API Support wrote: API Support wrote: Please provide a screenshot of the Historical Tester settings that you use.  
| Attachments: |
test2.png [73.43 KiB]
Downloaded 549 times
|
test1.png [88.08 KiB]
Downloaded 416 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.
|
|
|
|
|
|
 |
|
tcsabina
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Thu 03 Oct, 2013, 23:34
|
|
User rating: 164
Joined: Mon 08 Oct, 2012, 10:35 Posts: 676 Location: NetherlandsNetherlands
|
|
I think this is some kind of limitation/feature of the historical tester. It seems that you cannot submit an order at any time on any instrument.
@Support: Could you please clarify what is going on? I am really curious.... - Is it only possible to submit an order on a given instrument on the Historical Tester if a bar/tick was received for that instrument? As previously there is no price data for this instrument? - Is it only possible to submit an order on a given instrument in the onTick() method on the Historical Tester if the given instrument's tick triggered the onTick()?
Thanks!
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Fri 04 Oct, 2013, 12:14
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
zzping115 wrote: Scroll a bit lower in the report to see the USD/CHF instrument orders. tcsabina wrote: Is it only possible to submit an order on a given instrument on the Historical Tester if a bar/tick was received for that instrument? As previously there is no price data for this instrument? In Historical Tester you can only work with instruments that you have selected in its settings. tcsabina wrote: - Is it only possible to submit an order on a given instrument in the onTick() method on the Historical Tester if the given instrument's tick triggered the onTick()? This is not the case - you can submit an order on any of the selected instruments regardless what is the onTick's instrument parameter.
|
|
|
|
|
 |
|
CriticalSection
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Fri 04 Oct, 2013, 12:54
|
|
User rating: 70
Joined: Sat 22 Sep, 2012, 17:43 Posts: 118 Location: Brazil, Fortaleza, Ceará
|
|
On one hand I'm thinking he must have scrolled down before to see the two orders when he observed them before historical testing. On the otherhand, the Report clearly shows 'Turnover' on the account (23518.69) and in EUR/USD trades (13533.6). The missing 9985.09 says another trade took place in some other instrument other than EUR/USD.
|
|
|
|
|
 |
|
zzping115
|
| Post subject: Re: a question about test tools |
Post rating: 0
|
Posted: Sat 05 Oct, 2013, 01:36
|
|
User rating: 0
Joined: Wed 28 Mar, 2012, 06:41 Posts: 25 Location: China, Beijing
|
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|