<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>77z3-FX</title>
	<atom:link href="http://77z3-fx.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://77z3-fx.com</link>
	<description>Dukascopy&#039;s Introducing Agent &#38; External Account Manager</description>
	<lastBuildDate>Wed, 16 May 2012 18:48:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jForex order.getComission() not compiling</title>
		<link>http://77z3-fx.com/2012/01/13/jforex-order-getcomission-not-compiling/</link>
		<comments>http://77z3-fx.com/2012/01/13/jforex-order-getcomission-not-compiling/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 00:00:31 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> jForex]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3352</guid>
		<description><![CDATA[Bummer, the jForex order.getComission() is not compiling. After some research in Dukascopy support boards (http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=85&#38;t=43119) their response is following: Of course you cannot compile; these methods are introduced in an api version far above that what is currently in use in jforex. You can use them with the standalone api. Or you can calculate the [...]]]></description>
			<content:encoded><![CDATA[<p>Bummer, the jForex order.getComission() is not compiling. After some research in Dukascopy support boards (<a title="Dukascopy support" href="http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=85&amp;t=43119">http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=85&amp;t=43119</a>) their response is following:</p>
<pre>Of course you cannot compile; these methods are introduced in an api
version far above that what is currently in use in jforex. You can
use them with the standalone api. Or you can calculate the values
yourself.</pre>
<p>Thank you very much! Something, that could be easily set from their side, why do each person has to calculate it?!</p>
<h2>Not any more!</h2>
<p>I just coded a simple commission calculation function based on the commission tables and samples posted on the Dukascopy website: <a title="Dukascopy Commissions" href="http://www.dukascopy.com/swiss/english/forex/forex_trading_accounts/commission-policy/">http://www.dukascopy.com/swiss/english/forex/forex_trading_accounts/commission-policy/</a><br />
<script type="text/javascript">// <![CDATA[
  google_ad_client = "ca-pub-8537224990585880"; /* 77z3 Thankyou */ google_ad_slot = "9704330689"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&nbsp;</p>
<p>HERE IS THE CODE: Feel free to use it in your strategy <img src='http://77z3-fx.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre>private double calcComissionUSD(double Deposit, double Equity, double Lots) {
            double amount_array[]={0,5000,10000,25000,50000,250000,500000,1000000,5000000,10000000};
            double com_array[]={48,38,32,25,18,16,14,12,9,5};
            int comD=0,comE=0;
            ///Based on Deposit
            for (int i=0; i&lt;10; i++) {
                if (Deposit&gt;=amount_array[i]) {
                    comD=i;
                }
            }
            ///Based on Equity
            for (int i=0; i&lt;10; i++) {
                if (Equity&gt;=amount_array[i]) {
                    comE=i;
                }
            }
            int minvalue=Math.max(comD,comE);
            return Math.ceil(com_array[minvalue]*Lots*100)/100;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/13/jforex-order-getcomission-not-compiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jForex Indicator with multiple inputs &amp; outputs</title>
		<link>http://77z3-fx.com/2012/01/12/jforex-indicator-with-multiple-inputs-outputs/</link>
		<comments>http://77z3-fx.com/2012/01/12/jforex-indicator-with-multiple-inputs-outputs/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 23:13:30 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> jForex]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3335</guid>
		<description><![CDATA[Some things to keep in mind with when coding an indicator with multiple inputs &#38; outputs. 1. Define correct number of arrays I will need 2 time periods and 4 outputs, so first I have to make sure I start the arrays correctly: private int[] timePeriod = new int[2]; private double[][] outputs = new double[4][]; [...]]]></description>
			<content:encoded><![CDATA[<p>Some things to keep in mind with when coding an indicator with multiple inputs &amp; outputs.</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-12-at-2.57.46-PM.png"><img class="size-full wp-image-3337 alignnone" title="indicator with multiple outputs" src="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-12-at-2.57.46-PM.png" alt="indicator with multiple outputs" width="289" height="291" /></a></p>
<h2>1. Define correct number of arrays</h2>
<p>I will need 2 time periods and 4 outputs, so first I have to make sure I start the arrays correctly:</p>
<pre>private int[] timePeriod = new int[<span style="color: #ff0000;">2</span>];
private double[][] outputs = new double[<span style="color: #ff0000;">4</span>][];</pre>
<h2>2. Defining the correct parameter info for each item</h2>
<p>I need to define 2 periods and 4 ouputs</p>
<pre>indicatorInfo = new IndicatorInfo("maCross", "Moving Average Cross",
"My indicators",true, false, false, 1, <span style="color: #ff0000;">2</span>, <span style="color: #ff0000;">4</span>);

optInputParameterInfos = new OptInputParameterInfo[] {
   new OptInputParameterInfo("<span style="color: #ff0000;">Time period 1</span>:",
       OptInputParameterInfo.Type.OTHER,
       new IntegerRangeDescription(5, 2, 100, 1)),
   new OptInputParameterInfo("<span style="color: #ff0000;">Time period 2</span>:",
       OptInputParameterInfo.Type.OTHER,
       new IntegerRangeDescription(8, 2, 100, 1))
};

outputParameterInfos = new OutputParameterInfo[] {
   new OutputParameterInfo("<span style="color: #ff0000;">MA1</span>", OutputParameterInfo.Type.DOUBLE,
       OutputParameterInfo.DrawingStyle.LINE),
   new OutputParameterInfo("<span style="color: #ff0000;">MA2</span>", OutputParameterInfo.Type.DOUBLE,
       OutputParameterInfo.DrawingStyle.LINE),
   new OutputParameterInfo("<span style="color: #ff0000;">UP</span>", OutputParameterInfo.Type.DOUBLE,
       OutputParameterInfo.DrawingStyle.ARROW_SYMBOL_UP),
   new OutputParameterInfo("<span style="color: #ff0000;">DOWN</span>", OutputParameterInfo.Type.DOUBLE,
       OutputParameterInfo.DrawingStyle.ARROW_SYMBOL_DOWN)};</pre>
<h2>3. Calculating the Output Values</h2>
<p>You need to use arrays for input values. In my case for the &#8220;time Period 1&#8243; I have to use the first array value which is 0, and for the &#8220;time Period 2&#8243; I use the second array value which is 1</p>
<pre>outputs[0][j] = value/<span style="color: #ff0000;">timePeriod[0]</span>;
outputs[1][j] = value2/<span style="color: #ff0000;">timePeriod[1]</span>;
outputs[2][j] = 0;
outputs[3][j] = 0;</pre>
<p>Also make sure you find values for all outputs. I have 4 outputs, so I need values for outputs[0], outputs[1], outputs[2] and outputs[3].</p>
<h2>4. Download Sample Source code</h2>
<p>Here is a sample source code for a maCross indicator I just coded for practice.</p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-8537224990585880"; /* 77z3 Thankyou */ google_ad_slot = "9704330689"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>Click  to download: <a href="http://77z3-fx.com/wp-content/uploads/2012/01/maCross.zip">maCross.java</a></p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/12/jforex-indicator-with-multiple-inputs-outputs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding jForex Indicators with no Previous JAVA experience</title>
		<link>http://77z3-fx.com/2012/01/11/coding-jforex-indicators-with-no-previous-java-knowledge/</link>
		<comments>http://77z3-fx.com/2012/01/11/coding-jforex-indicators-with-no-previous-java-knowledge/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 05:53:19 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> jForex]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3292</guid>
		<description><![CDATA[I&#8217;ve been coding for MT4 for a while, and the mql4 coding was relatively easy to pick up since there&#8217;s so many samples, and good documentation to help you. My next challenge is to code an Indicator for Dukascopy jForex. Since I do not have any previous java knowledge and the documentation is not explaining [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been coding for MT4 for a while, and the mql4 coding was relatively easy to pick up since there&#8217;s so many samples, and good documentation to help you. My next challenge is to code an Indicator for Dukascopy jForex. Since I do not have any previous java knowledge and the documentation is not explaining much, I&#8217;ll have to experiment a lot, and see what works.</p>
<p>&nbsp;</p>
<p>So far I got started with a simple template provided in the jForex. Just right click on Strategies and open a New Indicator</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-11-at-6.01.37-PM.png"><img class="size-full wp-image-3293 alignnone" title="jforex - new  inidcator" src="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-11-at-6.01.37-PM.png" alt="jforex - new inidcator" width="243" height="243" /></a></p>
<p>You will end up with a small sample code, which helps to get a head start..</p>
<h2>1. Naming the Indicator</h2>
<p>One thing I did not know when I started my very first code for jForex is that the <span style="text-decoration: underline;"><em>class name</em></span> of your indicator or strategy <span style="text-decoration: underline;"><em>MUST match the file name</em></span>. Otherwise it will not compile without giving you errors.</p>
<pre>public class <span style="color: #ff0000;"><strong>Indicator</strong></span> implements IIndicator {</pre>
<p>I will try to make a Simple Moving Average Indicator as my first lesson. So I will name my indicator to myMA</p>
<pre>public class <strong>myMA</strong> implements IIndicator {</pre>
<h2>2. Defining the parameters</h2>
<p>This is what is already defined in the template:</p>
<pre>private IndicatorInfo indicatorInfo;
private InputParameterInfo[] inputParameterInfos;
private OptInputParameterInfo[] optInputParameterInfos;
private OutputParameterInfo[] outputParameterInfos;
private double[][] inputs = new double[1][];
private int timePeriod = 2;
private double[][] outputs = new double[1][];</pre>
<p>and since I won&#8217;t be needing any more parameters for the Moving Average indicator, I will leave this part untouched and move on to the next part</p>
<h2>3. Defining the Indicator info</h2>
<p>Moving on to the part with the following code:</p>
<pre>public void onStart(IIndicatorContext context) {</pre>
<p>This is where I define all setting (inputs and outputs) for the indicator. This is the code you see:</p>
<pre style="text-align: left;">indicatorInfo = new IndicatorInfo("EXAMPIND", "Sums previous values",
                "My indicators",
                false, false, false, 1, 1, 1);
inputParameterInfos = new InputParameterInfo[] {
      new InputParameterInfo("Input data",
      InputParameterInfo.Type.DOUBLE)};
optInputParameterInfos = new OptInputParameterInfo[] {
      new OptInputParameterInfo("Time period",
      OptInputParameterInfo.Type.OTHER,
      new IntegerRangeDescription(2, 2, 100, 1))};
outputParameterInfos = new OutputParameterInfo[] {
      new OutputParameterInfo("out", OutputParameterInfo.Type.DOUBLE,
      OutputParameterInfo.DrawingStyle.LINE)};</pre>
<p style="text-align: left;">Let me explain a bit what these lines of codes do. I searched for the info from different sources and have compiled here my understanding of the code. IndicatorInfo set the following things:</p>
<pre>indicatorInfo = new IndicatorInfo("EXAMPIND", "Sums previous values",
                "My indicators",<span style="color: #ff0000;">false</span>, <span style="color: #339966;">false</span>, <span style="color: #3366ff;">false</span>, <span style="color: #ff0000;">1</span>, <span style="color: #339966;">1</span>, <span style="color: #3366ff;">1</span>);</pre>
<p><strong>&#8220;EXAMPIND&#8221;</strong> = indicator name &#8211; gives a name by which you will be able to call it from strategy (should be simple);<br />
<strong>&#8220;Sums previous values&#8221;</strong> = indicator title &#8211; gives a title to this indicator &#8211; more detailed name which are used in JForex &#8220;add indicator&#8221; dialog window;<br />
<strong>&#8220;My indicators&#8221;</strong> =   Indicator groupName &#8211; specifies directory where it would be accessible thru JForex in &#8220;add indicator&#8221; dialog window;<br />
<span style="color: #ff0000;">false</span> =    overChart &#8211; true if indicator should be drawn over candles/ticks on the main chart (e.g. SMA); set it false if you want the indicator to show its values in a separate window;<br />
<span style="color: #339966;">false</span> =    overVolumes &#8211; true if indicator should be drawn over volume information;<br />
<span style="color: #3366ff;">false</span> =    unstablePeriod &#8211; true if indicator has unstable period (like EMA or SAR). This will add more candles in every call to stabilize function;<br />
<span style="color: #ff0000;">1</span> =    numberOfInputs &#8211; number of inputs that user should provide (e.g. price: open or close);<br />
<span style="color: #339966;">1</span> =    numberOfOptionalInputs &#8211; number of optional inputs (e.g. time period for SMA);<br />
<span style="color: #3366ff;">1</span> =    numberOfOutputs &#8211; number of outputs, that function returns (these are usually the number lines on the chart);</p>
<p>&nbsp;</p>
<p>So here is my line of code for the Simple Moving average:</p>
<pre>indicatorInfo = new IndicatorInfo("myMA", "Moving Average",
                "My indicators",<strong>true</strong>, false, false, 1, 1, 1);</pre>
<p>Notice that I changed the overChart value to be <strong>true</strong> since the Moving Average needs to draw over the candles.</p>
<h2>4. Setting up the inputs and outputs for the indicator (what data goes in and what/how needs to come out)</h2>
<p>The next lines will define what will be displayed in the &#8220;edit indicator&#8221; properties when launching the indicator.</p>
<pre>inputParameterInfos = new InputParameterInfo[] {
          new InputParameterInfo(<strong>"Input data"</strong>, <strong> InputParameterInfo.Type.DOUBLE)</strong>};</pre>
<p><strong>&#8220;Input data&#8221;</strong> = name for the input to display<br />
<strong>InputParameterInfo.Type.DOUBLE</strong> = type of data</p>
<p>&nbsp;</p>
<p>Here are the input data types (<span style="color: #3366ff;">InputParameterInfo.Type</span>) that can be used according to Dukascopy documentation:</p>
<p><strong>PRICE </strong>= Indicates that this input is price. Price includes open, close, high, low, volume<br />
<strong>DOUBLE</strong> = Indicates that this input is any double data<br />
<strong>BAR</strong> = Indicates that this input is IBar array</p>
<p>&nbsp;</p>
<p>We just have one data input for the Moving Average, so I&#8217;ll just change the name to the following:</p>
<pre>inputParameterInfos = new InputParameterInfo[] {
         new InputParameterInfo("Price:",
         InputParameterInfo.Type.DOUBLE)};</pre>
<h3><span style="text-decoration: underline;"><span style="color: #ff0000; text-decoration: underline;">What if you need to define 2 or more input variables?</span></span></h3>
<p>First, make sure your indicatorInfo in previous code line defines 2 inputs, or the number of inputs you need to define, in this sample it will be 3</p>
<pre>indicatorInfo = new IndicatorInfo("EXAMPIND", "Sums previous values",
                "My indicators",
                false, false, false, <span style="color: #ff0000;">3</span>, 1, 1);</pre>
<p>Then just keep adding inputs to this array. In this sample I will add 3 inputs, not that each <strong>new InputParameterInfo(..)</strong> is separated by commas in a list.</p>
<pre>inputParameterInfos = new InputParameterInfo[] {
    new InputParameterInfo("Price1:", InputParameterInfo.Type.DOUBLE),
    new InputParameterInfo("Price2:", InputParameterInfo.Type.DOUBLE),
    new InputParameterInfo("Price3:", InputParameterInfo.Type.DOUBLE)
};</pre>
<p>It works identically for the optInputParameterInfos and outputParameterInfos.</p>
<p>&nbsp;</p>
<p>Next I check the OptionalInputs, which will be the Time period for the Moving average. In this case I can leave the code untouched as the sample already defines it as a time period.</p>
<pre>optInputParameterInfos = new OptInputParameterInfo[] {
new OptInputParameterInfo("Time period",
OptInputParameterInfo.Type.OTHER,
new IntegerRangeDescription(2, 2, 100, 1))};</pre>
<p><span style="color: #3366ff;">OptInputParameterInfo.Type</span> can be following:<br />
<strong>CURRENCY</strong> = Optional input is currency<br />
<strong>DEGREE</strong> = Optional input is degree<br />
<strong>OTHER</strong> = Optional input is something other<br />
<strong>PERCENT</strong> = Optional input is percent</p>
<p>&nbsp;</p>
<p>Here is explanation for the <span style="color: #3366ff;">IntegerRangeDescription</span>:</p>
<pre>public <strong>IntegerRangeDescription</strong>(int defaultValue,
                               int min,
                               int max,
                               int suggestedIncrement)</pre>
<p><strong>defaultValue</strong> &#8211; default value, that is user if used doesn&#8217;t set optional input<br />
<strong>min</strong> &#8211; minimal value<br />
<strong>max</strong> &#8211; maximal value<br />
<strong>suggestedIncrement</strong> &#8211; suggested step to change this input</p>
<p>&nbsp;</p>
<p>The following step will be to check the Indicator outputs, which is the following code:</p>
<pre>outputParameterInfos = new OutputParameterInfo[] {
new OutputParameterInfo("out",
OutputParameterInfo.Type.DOUBLE,
OutputParameterInfo.DrawingStyle.LINE)};</pre>
<p>Where:<br />
<strong>&#8220;out&#8221;</strong> = name for the indicator output<br />
<strong>OutputParameterInfo.Type.DOUBLE</strong> = output type (double in this case)<br />
<strong>OutputParameterInfo.DrawingStyle.LINE</strong> = drawing style</p>
<p>&nbsp;</p>
<p><span style="color: #3366ff;">OutputParameterInfo.Type</span> can be following:<strong><br />
DOUBLE</strong> = Output is array of doubles, Double.NaN values means there is no value at that point<br />
<strong>INT</strong> = Output is array of integers, Integer.MIN_VALUE values means there is no value at that point<br />
<strong>OBJECT</strong> = Any object, outputs with this type can be only interpreted by strategies or drawn by selfdrawing indicators</p>
<p>&nbsp;</p>
<p><span style="color: #3366ff;">OutputParameterInfo.DrawingStyle</span> can be set to following:<strong><br />
ARROW_SYMBOL_DOWN</strong> = Draw arrow symbol at non NaN or no Integer.MIN_VALUE values<br />
<strong>ARROW_SYMBOL_UP</strong> = Draws arrow symbol at non NaN or no Integer.MIN_VALUE values<br />
<strong>DASH_LINE</strong> = Show output as dashed line<br />
<strong>DASHDOT_LINE</strong> = Show output as dashed and dotted line<br />
<strong>DASHDOTDOT_LINE</strong> = Show output as dashed and double dotted line<br />
<strong>DOT_LINE</strong> = Show output as dotted line<br />
<strong>DOTS</strong> = Show output as dots<br />
<strong>HISTOGRAM</strong> = Show output as histogram<br />
<strong>LEVEL_DASH_LINE</strong> = Show output as dashed level.<br />
<strong>LEVEL_DASHDOT_LINE</strong> = Show output as dashed and dotted level.<br />
<strong>LEVEL_DASHDOTDOT_LINE</strong> = Show output as dashed and double dotted level.<br />
<strong>LEVEL_DOT_LINE</strong> = Show output as dotted level.<br />
<strong>LEVEL_LINE</strong> = Show output as level.<br />
<strong>LINE</strong> = Show output as line<br />
<strong>NONE</strong> = Don&#8217;t draw anything<br />
<strong>PATTERN_BOOL</strong> = If value is not zero, then draw pattern<br />
<strong>PATTERN_BULL_BEAR</strong> = If value: == 0 &#8211; no pattern &gt; 0 &#8211; bullish &lt; 0 &#8211; bearish<br />
<strong>PATTERN_STRENGTH</strong> = If value: == 0 &#8211; neutral ]0..100] getting bullish ]100..<strong></strong></p>
<p><strong><br />
</strong></p>
<p>I&#8217;ll just change the output parameter name from &#8220;<strong>out</strong>&#8221; to &#8220;<strong>MA</strong>&#8221; for this indicator, so it will be following:</p>
<pre>outputParameterInfos = new OutputParameterInfo[] {
new OutputParameterInfo("<strong>MA</strong>",
OutputParameterInfo.Type.DOUBLE,
OutputParameterInfo.DrawingStyle.LINE)};</pre>
<h2> 5. Calculating The indicator Value</h2>
<p>The indicator value is calculated in this part of the code:</p>
<pre>public IndicatorResult calculate(int startIndex, int endIndex) {
        //calculating startIndex taking into account lookback value
        if (startIndex - getLookback() &lt; 0) {
            startIndex -= startIndex - getLookback();
        }
        int i, j;
        for (i = startIndex, j = 0; i &lt;= endIndex; i++, j++) {
            double value = 0;
            <span style="color: #ff0000;">for (int k = timePeriod; k &gt; 0; k--) {</span>
<span style="color: #ff0000;">                 value += inputs[0][i - k];</span>
<span style="color: #ff0000;">             }</span>
            outputs[0][j] = value;
        }
        return new IndicatorResult(startIndex, j);
}</pre>
<p>The sample code just adds the input values up into one big sum. As you can see it loops though the candles<strong> i=startIndex</strong> until <strong>i&lt;=endIndex</strong> and then loops again from<strong> k=TimePeriod</strong> to <strong>k&gt;0</strong> to collect the sum of timePeriod inputs. For moving average, we just need to find the average, meaning we need to divide the value with the number of variables we added together which is the<strong> timePeriod</strong>. The code will look like this:<strong></strong></p>
<pre>public IndicatorResult calculate(int startIndex, int endIndex) {
        //calculating startIndex taking into account lookback value
        if (startIndex - getLookback() &lt; 0) {
            startIndex -= startIndex - getLookback();
        }
        int i, j;
        for (i = startIndex, j = 0; i &lt;= endIndex; i++, j++) {
            double value = 0;
            for (int k = timePeriod; k &gt; 0; k--) {
                                   value += inputs[0][i - k];
                              }
            outputs[0][j] = value<span style="color: #ff0000;">/timePeriod;</span>
        }
        return new IndicatorResult(startIndex, j);
}</pre>
<h2>6. Compile &amp; Test<strong></strong></h2>
<p>Now we just need to compile the indicator, and put it on the charts. Here is the comparison with the built in SMA indicator. The red line is myMA and the green line is SMA</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-11-at-9.16.48-PM.png"><img class="alignright size-full wp-image-3311" title="myMA and SMA comparison" src="http://77z3-fx.com/wp-content/uploads/2012/01/Screen-shot-2012-01-11-at-9.16.48-PM.png" alt="myMA and SMA comparison" width="558" height="501" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>YES! &#8211; I just created my<strong> first indicator!</strong></p>
<h2><strong>7. Download the sample source code</strong><strong></strong></h2>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-8537224990585880"; /* 77z3 Thankyou */ google_ad_slot = "9704330689"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script><br />
If you wish to see the full source code of the myMA indicator, you can download it here:<strong> <a href="http://77z3-fx.com/wp-content/uploads/2012/01/myMA.zip">myMA.java</a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/11/coding-jforex-indicators-with-no-previous-java-knowledge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering out Flat candles in jForex Strategy</title>
		<link>http://77z3-fx.com/2012/01/09/filtering-out-flat-candles-in-jforex-strategy/</link>
		<comments>http://77z3-fx.com/2012/01/09/filtering-out-flat-candles-in-jforex-strategy/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 01:13:09 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> jForex]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3247</guid>
		<description><![CDATA[In my last post &#8220;jForex Moving average Strategy not giving the results seen on the charts&#8221; I have explained how my SMA results on the Strategy and chart were different. I was using the following simple code: indicators.ma(instrument,MAPERIOD,OfferSide.BID,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,0); &#160; How to filter out flat candles in the jForex Strategy: First we need to define what [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post &#8220;<a title="Permalink to jForex Moving average Strategy not giving the  results seen on the charts" href="../2012/01/09/jforex-moving-average-strategy-not-giving-the-rsults-seen-on-the-charts/" rel="bookmark">jForex Moving average Strategy not giving the results seen on the charts</a>&#8221; I have explained how my SMA results on the Strategy and chart were different.</p>
<p>I was using the following simple code:</p>
<pre>indicators.ma(instrument,MAPERIOD,OfferSide.BID,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,0);</pre>
<p>&nbsp;</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-8537224990585880";
/* 77z3 Thankyou */
google_ad_slot = "9704330689";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>How to filter out flat candles in the jForex Strategy:</h2>
<p>First we need to define what kind of filtering do we want to use. In the very beginning of your strategy where you define all variable, insert the following code:</p>
<pre>private static final Filter indFilter = Filter.WEEKENDS;</pre>
<p>The Filter values can be also following:</p>
<p>ALL_FLATS = filter all flats (weekend, and other flat candles during trading hours)</p>
<p>NO_FILTER = don&#8217;t filter anything</p>
<p>WEEKENDS = Filter flats at the weekends (21:00 or 22:00 Friday &#8211; 21:00 or 22:00 Sunday)</p>
<p>Note that the default filter you see on your charts is the Weekends filter, unless you change it from the settings.</p>
<p>&nbsp;<br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-8537224990585880";
/* 77z3 Thankyou */
google_ad_slot = "9704330689";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Then we replace the simple ma function I used before with this one:</p>
<pre>indicators.ma(instrument,MAPERIOD,OfferSide.BID,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,indFilter,1,bidBar.getTime(),0)[0];</pre>
<p>And that does the trick!</p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/filtering-out-flat-candles-in-jforex-strategy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real / Live Results</title>
		<link>http://77z3-fx.com/2012/01/09/year-2011-score/</link>
		<comments>http://77z3-fx.com/2012/01/09/year-2011-score/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 01:10:59 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[Real/Live Results]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3254</guid>
		<description><![CDATA[Real/Live Personal Accounts will be displayed here. PAMM Accounts at Dukascopy are not on display but they will be soon.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Results" href="http://www.myfxbook.com/members/SaltyWaters" target="_blank"><img title="market1" src="http://77z3-fx.com/wp-content/uploads/2011/10/market1-300x225.jpg" alt="" width="300" height="225" /><br />
</a></p>
<p style="text-align: center;"><strong>Real/Live Personal Accounts will be displayed here.</strong></p>
<p style="text-align: center;"><strong>PAMM Accounts at Dukascopy are not on display but they will be soon.<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/year-2011-score/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2012 New Accounts</title>
		<link>http://77z3-fx.com/2012/01/09/real-live-results/</link>
		<comments>http://77z3-fx.com/2012/01/09/real-live-results/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 01:00:44 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[Real/Live Results]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3248</guid>
		<description><![CDATA[2012 New Accounts These are live personal accounts and are using a different strategy than the PAMM accounts. * *]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: center;">2012 New Accounts</h2>
<p style="text-align: center;">These are live personal accounts and are using a different strategy than the PAMM accounts.</p>
<p style="text-align: center;"><a href="http://www.myfxbook.com/members/SaltyWaters/thinkforex/218768"><img src="http://www.myfxbook.com/widgets/218768/large.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">*</p>
<p style="text-align: center;"><a href="http://www.myfxbook.com/members/SaltyWaters/finfx/219393"><img class="aligncenter" src="http://www.myfxbook.com/widgets/219393/large.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">*</p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/real-live-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Room</title>
		<link>http://77z3-fx.com/2012/01/09/3242/</link>
		<comments>http://77z3-fx.com/2012/01/09/3242/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 00:26:43 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> Test Room]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3242</guid>
		<description><![CDATA[  All EAs are made from scratch and are my own creation. New automated Robots will be tested here for technical and performance issues before going Live on a Real account. Accounts will be deleted after tests are concluded or issues detected. *** dWaver&#8217;s 10 years Back Test: GBPJPY The Power of Compounding: $10k to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong> </strong><span class="Apple-style-span" style="color: #000000; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 12px; line-height: 18px;"><img class="aligncenter" title="test2" src="http://77z3-fx.com/wp-content/uploads/2011/10/test2-300x225.jpg" alt="" width="300" height="225" /></span></p>
<p style="text-align: center;"><span class="Apple-style-span" style="color: #000000; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 12px; line-height: 18px;"><span class="Apple-style-span" style="font-size: 16px; color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px;"><strong>All EAs are made from scratch and are my own creation.</strong></span></span></p>
<p style="text-align: center;"><strong>New automated Robots will be tested here for technical and performance issues before going Live on a Real account. Accounts will be deleted after tests are concluded or issues detected.</strong></p>
<p style="text-align: center;"><strong><br />
</strong></p>
<p style="text-align: center;">***</p>
<h2 style="text-align: center;"><strong>dWaver&#8217;s 10 years Back Test: GBPJPY</strong></h2>
<p style="text-align: center;"><strong>The Power of Compounding: $10k to $1 million</strong></p>
<p style="text-align: center;">
<p style="text-align: center;"><a title="2010 - 2011" href="http://www.myfxbook.com/strategies/dwaver-10-2010-2011-test/12136" target="_blank"><img class="aligncenter size-full wp-image-3461" title="dWaver 2010 - 2011" src="http://77z3-fx.com/wp-content/uploads/2012/01/dWaver-2010-2011.png" alt="" width="862" height="350" /></a>2010 -2011</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a title="2001 - 2009" href="http://www.myfxbook.com/strategies/dwaver-10-2001-2009-test/12134" target="_blank"><img class="aligncenter size-full wp-image-3462" title="dWaver 2001 - 2009" src="http://77z3-fx.com/wp-content/uploads/2012/01/dWaver-2001-2009.png" alt="" width="860" height="355" /></a>2001 &#8211; 2009</p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/3242/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Year 2011 score</title>
		<link>http://77z3-fx.com/2012/01/09/year-2011-live-results/</link>
		<comments>http://77z3-fx.com/2012/01/09/year-2011-live-results/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 00:04:29 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[Real/Live Results]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3230</guid>
		<description><![CDATA[Year 2011 score: 290% Growth in all Portfolio Accounts * Accounts held @ FXCM and FXDD were closed near the end of 2011. The reason there is a drop on the charts on the last month is because I did remove dWaver EA and had the stupid idea of testing a new EA on the [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;">Year 2011 score:<br />
290% Growth in all Portfolio Accounts</h1>
<p style="text-align: center;">*</p>
<p style="text-align: center;"><a href="http://www.myfxbook.com/members/SaltyWaters/fxcm-closed/219073"><img src="http://www.myfxbook.com/widgets/219073/large.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;"><a href="http://www.myfxbook.com/members/SaltyWaters/dwaver-v31-3/160308" target="_blank"><br />
</a></p>
<p style="text-align: center;"><a href="http://www.myfxbook.com/members/SaltyWaters/fxdd-closed/219395"><img src="http://www.myfxbook.com/widgets/219395/large.jpg" alt="" border="0" /></a></p>
<p style="text-align: center;">Accounts held @ FXCM and FXDD were closed near the end of 2011.</p>
<p style="text-align: center;">The reason there is a drop on the charts on the last month is because I did remove dWaver EA and had the stupid idea of testing a new EA on the accounts (these were my personal accounts not PAMM accounts). Anyhow, lesson learned.</p>
<p style="text-align: center;">***</p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/year-2011-live-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jForex Moving average Strategy not giving the results seen on the charts</title>
		<link>http://77z3-fx.com/2012/01/09/jforex-moving-average-strategy-not-giving-the-rsults-seen-on-the-charts/</link>
		<comments>http://77z3-fx.com/2012/01/09/jforex-moving-average-strategy-not-giving-the-rsults-seen-on-the-charts/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 23:18:24 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> jForex]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3195</guid>
		<description><![CDATA[I was writing a simple strategy in jForex when I notice the SMA results in the strategy did not match the charts. I was using the following code to find the SMA value: indicators.ma(instrument,MAPERIOD,OfferSide.BID,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,0); This is the results that I got on the test. As you can notice the MA-s do not cross, but yet [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing a simple strategy in jForex when I notice the SMA results in the strategy did not match the charts.</p>
<p>I was using the following code to find the SMA value:</p>
<pre><span style="color: #000000;">indicators.ma(instrument,MAPERIOD,OfferSide.BID,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,0);</span></pre>
<p>This is the results that I got on the test. As you can notice the MA-s do not cross, but yet the jForex Strategy entered a trade.</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-MAs-no-cross.png"><img class="alignnone size-full wp-image-3197" title="jforex MAs no cross" src="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-MAs-no-cross.png" alt="jforex MAs no cross" width="492" height="446" /></a></p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-8537224990585880";
/* 77z3 Thankyou */
google_ad_slot = "9704330689";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>After a few hours of cracking my head, I found out why is this happening: Jforex default setting filter out all weekend flat candles (Settings -&gt; Charts)</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-default-chart-settings.png"><img class="alignnone size-full wp-image-3198" title="jforex default chart settings" src="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-default-chart-settings.png" alt="jforex default chart settings" width="535" height="442" /></a></p>
<p>After changing the Flat filters &#8220;disabled&#8221;, you will see the following results, which now match with the Strategy results.</p>
<p><a href="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-flats-filter-disabled.png"><img class="alignnone size-full wp-image-3203" title="jforex flats filter disabled" src="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-flats-filter-disabled.png" alt="jforex flats filter disabled" width="536" height="439" /></a><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-8537224990585880";
/* 77z3 Thankyou */
google_ad_slot = "9704330689";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<a href="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-chart-with-flats-filter-disabled1.png"><img class="alignnone size-full wp-image-3204" title="jforex chart with flats filter disabled" src="http://77z3-fx.com/wp-content/uploads/2012/01/jforex-chart-with-flats-filter-disabled1.png" alt="jforex chart with flats filter disabled" width="738" height="475" /></a></p>
<p>As seen on the above image, the strategy entered after the 2 MA-s crossed.</p>
<p>&nbsp;</p>
<p><strong>What does this mean?</strong></p>
<p>This means that the simple ma function in jForex does not filter out the weekend flat candles. I will be showing how to filter out the flat candles in the jForex strategy in the next post &#8220;<a title="Permalink to Filtering out Flat candles in jForex Strategy" href="../2012/01/09/filtering-out-flat-candles-in-jforex-strategy/" rel="bookmark">Filtering out Flat candles in jForex Strategy</a>&#8220;.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2012/01/09/jforex-moving-average-strategy-not-giving-the-rsults-seen-on-the-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Holidays!</title>
		<link>http://77z3-fx.com/2011/11/24/noodle-dream/</link>
		<comments>http://77z3-fx.com/2011/11/24/noodle-dream/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 23:30:24 +0000</pubDate>
		<dc:creator>77z3-FX</dc:creator>
				<category><![CDATA[>> TRADES]]></category>

		<guid isPermaLink="false">http://77z3-fx.com/?p=3044</guid>
		<description><![CDATA[Year 2011 score: 290% Growth in all Portfolio Accounts]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://77z3-fx.com/wp-content/uploads/2011/11/SantaSmiley.jpg"><img class="alignnone size-medium wp-image-3095" title="SantaSmiley" src="http://77z3-fx.com/wp-content/uploads/2011/11/SantaSmiley-300x273.jpg" alt="" width="300" height="273" /></a></p>
<h1 style="text-align: center;"><span style="color: #ff00ff;"><strong>Year 2011 score:</strong></span></h1>
<h1 style="text-align: center;"><span style="color: #ff00ff;"><strong>290% Growth in all Portfolio Accounts</strong></span></h1>
]]></content:encoded>
			<wfw:commentRss>http://77z3-fx.com/2011/11/24/noodle-dream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

