Dukascopy
 
 
Wiki JStore Search Login

APICLIENT-239 How to open a customer indicator in the Strategy
 Post subject: APICLIENT-239 How to open a customer indicator in the Strategy Post rating: 0   New post Posted: Tue 07 Aug, 2012, 11:19 

User rating: 0
Joined: Tue 07 Aug, 2012, 11:12
Posts: 2
I am new in Jforex and I start to code my strategy from MT4. But it looks converted file have bugs:

A customer indicator in MT4 is open like this:
ATRUp1 = iCustom(NULL, 0, "ATRStops", ATRLength, ATRPeriod, ATRKv, 0, 1);

A converted java sentence like this:
ATRUp1=toDouble(iCustom(toInstrument(null),toPeriod(0),toString("ATRStops"),ATRLength,ATRPeriod,ATRKv,0,1));

It failed to open ATRStops indicator, How can I modify it?


 
 Post subject: Re: How to open a customer indicator in the Strategy. Post rating: 0   New post Posted: Tue 07 Aug, 2012, 11:34 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please see the disclaimer at the top of the converted java file. For custom indicator calls in jforex strategies see:
https://www.dukascopy.com/wiki/#Use_cust ... strategies


 
 Post subject: Re: How to open a customer indicator in the Strategy. Post rating: 0   New post Posted: Sat 11 Aug, 2012, 15:31 

User rating: 0
Joined: Tue 07 Aug, 2012, 11:12
Posts: 2
API Support wrote:
Please see the disclaimer at the top of the converted java file. For custom indicator calls in jforex strategies see:
https://www.dukascopy.com/wiki/#Use_cust ... strategies


Thank you for your answer. But it does not solve my problem.
The disclaimer is like following:

package jforex.converted;
import java.awt.Color;
import com.dukascopy.api.*;
import com.dukascopy.connector.engine.*;
/** Disclaimer: The folllowing source code is to be used for troubleshooting purposes only.
* Please don't use it for strategy/indicator compilation.
*/

public class H1ABC_Dukascopy_V25 extends MQL4ConnectorStrategy
{

protected void initProperties()
{
if (properties == null)
{
properties = new Properties();
}
properties.setProperty("link","http:");
properties.setProperty("copyright","Copyright 2012.06.24, Felix zhang");
}

And I do not found any OnStart() function for the registration of customer indicator because it is converted from MQL4.

Would you please give me more clear and simple instruction regarding registraion and use following sentence:

ATRUp1=toDouble(iCustom(toInstrument(null),toPeriod(0),toString("ATRStops"),ATRLength,ATRPeriod,ATRKv,0,1));

The customer indicator ATRStops is converted and running well. It has three parameters: ATRLength,ATRPeriod,ATRKv


 
 Post subject: Re: APICLIENT-239 How to open a customer indicator in the Strategy Post rating: 0   New post Posted: Mon 13 Aug, 2012, 09:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please read the original post:
viewtopic.php?f=16&t=47063
More particular the section "Converted indicator usage from strategy". It contains two example strategies.


 

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