Dukascopy
 
 
Wiki JStore Search Login

plase help with ind after MQL4Connector
 Post subject: plase help with ind after MQL4Connector Post rating: 0   New post Posted: Fri 29 Apr, 2016, 13:38 
User avatar

User rating: 1
Joined: Sat 27 Jul, 2013, 16:42
Posts: 17
Location: Russian Federation, Saint-Petersburg
hi support.
please advice and check this indicator,
how can get/use this parameters for strategy after converted MQL4Connector in jforex strategy code?

thanks

 
/*
 * Decompiled with CFR 0_115.
 *
 * Could not load the following classes:
 *  com.dukascopy.api.JFException
 *  com.dukascopy.connector.engine.MQL4Connector
 *  com.dukascopy.connector.engine.MQL4ConnectorIndicator
 *  com.dukascopy.connector.engine.Properties
 */
package jforex.converted;

import com.dukascopy.api.JFException;
import com.dukascopy.connector.engine.MQL4Connector;
import com.dukascopy.connector.engine.MQL4ConnectorIndicator;
import com.dukascopy.connector.engine.Properties;
import java.awt.Color;

public class I_XO_A_H
extends MQL4ConnectorIndicator {
    MQL4Connector mqlConnector;
    static String timeZone = "GMT+3";
    protected Color indicator_color1;
    protected Color indicator_color2;
    public int BoxSize;
    public double[] ExtMapBuffer1;
    public double[] ExtMapBuffer2;
    int Cur;
    int KirUp;
    int KirDn;
    int kr;
    int no;
    double valueh;
    double valuel;
    String shortname;

    public int deinit() throws JFException {
        return this.toInt((Object)0);
    }

    public I_XO_A_H() {
        this.mqlConnector = this;
        this.indicator_color1 = this.toColor((Object)Green);
        this.indicator_color2 = this.toColor((Object)Red);
        this.BoxSize = 0;
        this.Cur = 0;
        this.KirUp = 0;
        this.KirDn = 0;
        this.kr = 0;
        this.no = 0;
        this.valueh = 0.0;
        this.valuel = 0.0;
        try {
            this.BoxSize = this.toInt((Object)15);
            this.ExtMapBuffer1 = new double[10000];
            this.ExtMapBuffer2 = new double[10000];
            this.Cur = this.toInt((Object)0);
            this.KirUp = this.toInt((Object)0);
            this.KirDn = this.toInt((Object)0);
            this.kr = this.toInt((Object)0);
            this.no = this.toInt((Object)0);
            this.valueh = this.toDouble((Object)0);
            this.valuel = this.toDouble((Object)0);
            this.shortname = this.toStr((Object)"");
        }
        catch (JFException e) {
            throw new Error((Throwable)e);
        }
    }

    public void initProperties() {
        if (this.properties == null) {
            this.properties = new Properties((Object)this);
        }
        this.properties.setProperty("indicator_color1", "Green");
        this.properties.setProperty("indicator_separate_window", "true");
        this.properties.setProperty("indicator_color2", "Red");
        this.properties.setProperty("copyright", "");
        this.properties.setProperty("connector_max_bars", "500");
        this.properties.setProperty("connector_calculate_once_per_bar", "true");
        this.properties.setProperty("connector_dll_path", ".");
        this.properties.setProperty("link", "");
        this.properties.setProperty("indicator_buffers", "2");
        this.properties.setProperty("connector_recalculate_all", "true");
        this.properties.setProperty("connector_timezone", "GMT+3");
    }

    public int init() throws JFException {
        this.mqlConnector.SetIndexStyle(this.toInt((Object)0), this.toInt((Object)2));
        this.mqlConnector.SetIndexBuffer(this.toInt((Object)0), this.ExtMapBuffer1);
        this.mqlConnector.SetIndexLabel(this.toInt((Object)0), this.toStr((Object)"XOUP"));
        this.mqlConnector.SetIndexStyle(this.toInt((Object)1), this.toInt((Object)2));
        this.mqlConnector.SetIndexBuffer(this.toInt((Object)1), this.ExtMapBuffer2);
        this.mqlConnector.SetIndexLabel(this.toInt((Object)1), this.toStr((Object)"XODOWN"));
        this.shortname = this.toStr((Object)("I_XO | byClau :: [Val: " + this.BoxSize + "] "));
        this.mqlConnector.IndicatorShortName(this.toStr((Object)this.shortname));
        return this.toInt((Object)0);
    }

    public int start() throws JFException {
        int CurrentBar = 0;
        double Hi = 0.0;
        double Lo = 0.0;
        double Curb = 0.0;
        int i = this.toInt((Object)0);
        this.toInt((Object)this.mqlConnector.IndicatorCounted());
        i = this.toInt((Object)0);
        while (this.lessThanOrEqualTo((Object)i, (Object)this.Bars)) {
            CurrentBar = this.toInt((Object)(this.Bars - i));
            if (this.toBool((Object)this.lessThan((Object)this.Cur, (Object)1))) {
                Hi = this.toDouble((Object)this.mqlConnector.Close(this.toInt((Object)CurrentBar)));
                Lo = this.toDouble((Object)this.mqlConnector.Close(this.toInt((Object)CurrentBar)));
                this.Cur = this.toInt((Object)1);
            }
            if (this.toBool((Object)this.greaterThan((Object)(Curb = this.toDouble((Object)this.mqlConnector.Close(this.toInt((Object)CurrentBar)))), (Object)(Hi + (double)this.BoxSize * this.Point)))) {
                this.Cur = this.toInt((Object)(this.Cur + this.toInt((Object)1)));
                Hi = this.toDouble((Object)Curb);
                Lo = this.toDouble((Object)(Curb - (double)this.BoxSize * this.Point));
                this.KirUp = this.toInt((Object)1);
                this.KirDn = this.toInt((Object)0);
                this.kr = this.toInt((Object)(this.kr + this.toInt((Object)1)));
                this.no = this.toInt((Object)0);
            }
            if (this.toBool((Object)this.lessThan((Object)Curb, (Object)(Lo - (double)this.BoxSize * this.Point)))) {
                this.Cur = this.toInt((Object)(this.Cur + this.toInt((Object)1)));
                Lo = this.toDouble((Object)Curb);
                Hi = this.toDouble((Object)(Curb + (double)this.BoxSize * this.Point));
                this.KirUp = this.toInt((Object)0);
                this.KirDn = this.toInt((Object)1);
                this.no = this.toInt((Object)(this.no + this.toInt((Object)1)));
                this.kr = this.toInt((Object)0);
            }
            this.valueh = this.toDouble((Object)this.kr);
            this.valuel = this.toDouble((Object)(0 - this.no));
            this.setValue(this.ExtMapBuffer1, CurrentBar, this.toDouble((Object)this.valueh));
            this.setValue(this.ExtMapBuffer2, CurrentBar, this.toDouble((Object)this.valuel));
            ++i;
        }
        return this.toInt((Object)0);
    }
}



 

Jump to:  

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