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.

How to get the value of maEnvelope...
 Post subject: How to get the value of maEnvelope... Post rating: 0   New post Posted: Thu 11 Apr, 2013, 12:33 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
my codes are error codes! the result is “11:29:47 MymaEnvelope is[D@32a729”.
How can I get the value of maEnvelope?
thanks for your help.

package jforex;

import java.util.*;

import com.dukascopy.api.*;
import com.dukascopy.api.IEngine.*;
import com.dukascopy.api.IIndicators;

public class Strategy implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
    private IOrder order;
   
    public Instrument MyInstrument = Instrument.EURUSD;
    public Period MyPeriod = Period.FIVE_MINS;
    public OfferSide MyOfferSide = OfferSide.BID;
    public int MySMATimePeriod = 4;
   
    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();
       
        double[] MymaEnvelope = indicators.maEnvelope(MyInstrument, MyPeriod, MyOfferSide, IIndicators.AppliedPrice.CLOSE, MySMATimePeriod, 0.07, 0);
        console.getOut().println("MymaEnvelope is"+MymaEnvelope);
    }

    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 {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
       
    }
}


 
The Best Answer  Post subject: Re: How to get the value of maEnvelope... Post rating: 1   New post Posted: Thu 11 Apr, 2013, 13:55 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi wenchao35:

On console.getout() replace MymaEnvelope by Arrays.toString(MymaEnvelope)

You are trying to print a array of doubles... the way you use only prints the reference to the object.

Trade well

JL


 
 Post subject: Re: How to get the value of maEnvelope... Post rating: 0   New post Posted: Fri 12 Apr, 2013, 07:01 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
jlongo wrote:
Hi wenchao35:

On console.getout() replace MymaEnvelope by Arrays.toString(MymaEnvelope)

You are trying to print a array of doubles... the way you use only prints the reference to the object.

Trade well

JL



thank you !!I FIXED IT !!


 

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