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.

Analogy for MT4 scripts in JForex?
 Post subject: Analogy for MT4 scripts in JForex? Post rating: 0   New post Posted: Thu 02 Jun, 2011, 18:30 

User rating: -
Is there a way to simulate an MT4 script in JForex? That is to stop a strategy automatically after the onStart method is done executing?


 
 Post subject: Re: Analogy for MT4 scripts in JForex? Post rating: 0   New post Posted: Fri 03 Jun, 2011, 07:36 

User rating: -
I found a hack: just throw a JFException at the end of the onStart method.


 
 Post subject: Re: Analogy for MT4 scripts in JForex? Post rating: 0   New post Posted: Fri 03 Jun, 2011, 11:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You might as well consider calling IContext.stop() in onTick method, which effectively will close the strategy on its first tick.


 
 Post subject: Re: Analogy for MT4 scripts in JForex? Post rating: 0   New post Posted: Fri 03 Jun, 2011, 15:08 

User rating: -
Thanks. I tried calling IContext.stop() at the end of the onStart method and it also worked.


 

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