<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Tutorial: Building Custom Indicator with FSB]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/1380/" />
	<updated>2017-02-02T17:25:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/1380/tutorial-building-custom-indicator-with-fsb/</id>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41339/#p41339" />
			<content type="html"><![CDATA[<p>Footon is here most of the time only posts when he is concerned.</p><p>Actually, we have so many choices of indicators that additional ones are not really required. There are only a couple primary purposes for indicators like trend and range and volatility....... and I am sure those are adequately covered with the present inventory.</p><p>By adding indicators, we reduce processing time and complex what we are trying to do.</p><p>The generator explores all possibilities of the math on a random basis....... there are literally thousands of calculation patterns, maybe millions, available for the generator....... considering that each indicator has five or seven variables.</p><p>My current interest in indicators is to reduce the number of iterations to get to the good news quicker.</p>]]></content>
			<author>
				<name><![CDATA[Blaiserboy]]></name>
				<uri>https://forexsb.com/forum/user/2491/</uri>
			</author>
			<updated>2017-02-02T17:25:30Z</updated>
			<id>https://forexsb.com/forum/post/41339/#p41339</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41333/#p41333" />
			<content type="html"><![CDATA[<p>well thank you for at least looking and trying to help <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I haven&#039;t seen Footon recently, in fact it doesn&#039;t seem there have been any new indicators in quite awhile.</p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-02-02T15:25:14Z</updated>
			<id>https://forexsb.com/forum/post/41333/#p41333</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41307/#p41307" />
			<content type="html"><![CDATA[<p>haha&nbsp; no way I can answer questions about indicators, I know zilch...... I am learning from your questions...</p><p>A couple people have learned a lot about the indicators...... Footon is one of those......, myself, I am just hoping you keep asking questions. lol</p>]]></content>
			<author>
				<name><![CDATA[Blaiserboy]]></name>
				<uri>https://forexsb.com/forum/user/2491/</uri>
			</author>
			<updated>2017-02-02T07:12:34Z</updated>
			<id>https://forexsb.com/forum/post/41307/#p41307</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41295/#p41295" />
			<content type="html"><![CDATA[<p>awesome thanks Mr Popov, that&#039;s exactly the information I was looking for! <br />by the way, I have to say I&#039;m very impressed with what you have created.<br />You basically not only created your own strategy tester/builder but also pretty much your own language <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />My only concern continues to be the chance for differences between the .cs indicator and the .mq5 one that needs to be created separately.&nbsp; I&#039;m not sure if you downloaded the 2 indicators I created. I&#039;m still not 100% confident that my mql code is working exactly like my .cs code.&nbsp; &nbsp;I still see cases where sometimes when I backtest in MT5 the results look similar, and yet sometimes they are totally different.&nbsp; It will show a great equity curve in FSB but then it will lose in MT5.<br />Do you know what may cause that discrepancy other than the mq5 code not matching the .cs? <br />Thanks again and have a good day,<br />Jim</p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-02-01T13:05:28Z</updated>
			<id>https://forexsb.com/forum/post/41295/#p41295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41279/#p41279" />
			<content type="html"><![CDATA[<p>Probably you missed the very big difference between the FSB Pro and MT backtesting engine:<br />- MT re-calculates indicators at every &quot;tick&quot;. Here tick means a particular price in the data series. It starts from the beginning and goes forward to the newest bar.</p><p>- FSB Pro calculates the indicators only once for the complete DataSet. Depending on the indicator&#039;s role it uses different &quot;components&quot; of type <a href="https://github.com/PopovMP/FSB_Pro_Indicators/blob/master/Infrastructure/Enums/IndComponentType.cs">IndComponentType</a>&nbsp; to save the output values. The IndicatorComponent has a value array. It is with the length of the DataSet. The &quot;value&quot; have one value of type &quot;double&quot; for each bar. </p><p>Value of 0 means no entry/ exit price or entry/exit signal.</p><p>&nbsp; &nbsp;- IndComponentType.OpenLongPrice - the component.value stores the entry price for a long position. It has one entry price for a bar. It can be bar Open for indicators as &quot;Bar opening&quot; or other value for indicators as &quot;Moving Average&quot; or &quot;Pivot Point&quot;<br />&nbsp; &nbsp;- IndComponentType.OpenShortPrice - stores an entry price for short positions.<br />&nbsp; &nbsp;- .OpenPrice - entry price for both long and short entries. This can be used for indicators that have a single entry price (Moving Average, Bar Opening...)<br />&nbsp; &nbsp;- .CloseLongPrice, .CloseShortPrice, .ClosePrice - are the same as above but FSB checks them for closing.</p><p>&nbsp; &nbsp;- .OpenClosePrice - here you can set a single value that will work for both entry and exit in both directions. (for example Moving Average)</p><p>&nbsp; - .IndicatorValue - you use this type to store a value that you want to show in the chart or in the dynamic info, but it doesn&#039;t affect the trading. For example, the middle line of Bollinger Bands.</p><p> - .AllowOpenLong, .AllowOpenShort - you set 0 or 1 for these types. FSB uses them to check if long or short entry is allowed for the bar.</p><p> - .ForceCloseLong, .ForceCloseShort, .ForceClose the same as above but for &quot;allowing&quot; closing signals.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-02-01T07:52:37Z</updated>
			<id>https://forexsb.com/forum/post/41279/#p41279</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41277/#p41277" />
			<content type="html"><![CDATA[<p>ok, i finally figured out what my problem is. You say Bars-1 is the current bar, but that really means the last bar in the series.&nbsp; I need to backtest my indicator and i need bar to equal the bar it&#039;s currently testing. Using bar-1 just means the very last bar, so the back test doesn&#039;t show anything.&nbsp; So let me re-phrase my question, what variable is the current bar the backtester is working on.&nbsp; Does that make sense?&nbsp; thanks!</p><p>EDIT - ok I think I understand now. I&#039;m so used to metatrader and trading station coding/backtesting.</p><p>I see since the data set is loaded in advance, I need to create my own loop to represent the current bar, <br />as in for (int bar = 0;bar &lt; Bars; bar++)<br />then bar is the current bar for the calculations.</p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-02-01T05:04:41Z</updated>
			<id>https://forexsb.com/forum/post/41277/#p41277</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41271/#p41271" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><div class="quotebox"><blockquote><p>how many indicators do I have to create to get a free copy haha <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />I am running out of computers to run the demo</p></blockquote></div><p>Yes, FSB Pro is an excellent excuse to buy one more every two weeks <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><br /><p>I&#039;ll give you an idea:</p><p>When the Trial expires, FSB Pro doesn&#039;t want to save strategies... <br />However it happily saves collections.</p></blockquote></div><p>haha yeah, I don&#039;t think my wife would go along with that, but I agree it&#039;s a great excuse <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>thanks that&#039;s good to know!</p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-01-31T23:47:44Z</updated>
			<id>https://forexsb.com/forum/post/41271/#p41271</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41268/#p41268" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><div class="quotebox"><blockquote><p>you create a new IndicatorComp, and set the type to IndComponentType.AllowOpenLong.&nbsp; <br />Then when that value is a 1 it will open a trade? Is that right?</p></blockquote></div><p>Yes, this is correct.</p><p>We set &quot;1&quot; where the indicator allows an entry and &quot;0&quot; where no entry is allowed.</p></blockquote></div><p>Thanks for all the help Mr Popov, does that just mean whether long trade and short trades are allowed or is that the actual signal to buy/sell? I don&#039;t see anything else that looks like a buy/sell signal.</p><p>also I take it we cannot reference the ask or bid price separately, I assume it&#039;s always the ask price?</p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-01-31T23:43:12Z</updated>
			<id>https://forexsb.com/forum/post/41268/#p41268</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41246/#p41246" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>how many indicators do I have to create to get a free copy haha <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />I am running out of computers to run the demo</p></blockquote></div><p>Yes, FSB Pro is an excellent excuse to buy one more every two weeks <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><br /><p>I&#039;ll give you an idea:</p><p>When the Trial expires, FSB Pro doesn&#039;t want to save strategies... <br />However it happily saves collections.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-01-31T01:35:28Z</updated>
			<id>https://forexsb.com/forum/post/41246/#p41246</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41245/#p41245" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>also do the trades open on tick data (intrabar) or bar open? Is that decided by the indicator or FSB?</p></blockquote></div><p>You can safely pretend that all calculations are executed on &quot;tick&quot; data. Actually there is no such thing, but the backtetsing engine cleverly puts a tick at the point of the execution. <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> It is more &quot;ticky&quot; than the MetaTrader&#039;s &quot;every tick&quot; mode.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-01-31T01:32:57Z</updated>
			<id>https://forexsb.com/forum/post/41245/#p41245</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41244/#p41244" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>you create a new IndicatorComp, and set the type to IndComponentType.AllowOpenLong.&nbsp; <br />Then when that value is a 1 it will open a trade? Is that right?</p></blockquote></div><p>Yes, this is correct.</p><p>We set &quot;1&quot; where the indicator allows an entry and &quot;0&quot; where no entry is allowed.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-01-31T01:28:24Z</updated>
			<id>https://forexsb.com/forum/post/41244/#p41244</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41243/#p41243" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>is there a way to draw an indicator into the future?</p></blockquote></div><p>No, we cannot. The indicator uses the data series provided to it from the strategy. <br />You can &quot;delay&quot; the signals by using &quot;shift&quot; as in Moving Average:</p><div class="codebox"><pre><code> protected double[] MovingAverage(int period, int shift, MAMethod maMethod, double[] source)</code></pre></div><p>But the shift cannot be negative. This limitation is done to provide equal behaviour in the tests and in the trading. Obviously we cannot see an indicator form the future in live trading, so we have not to use it for backtesting.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-01-31T01:24:55Z</updated>
			<id>https://forexsb.com/forum/post/41243/#p41243</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41242/#p41242" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><div class="quotebox"><blockquote><p>Is the current bar 0 or 62777?</p></blockquote></div><p>We give the data series to the indicator via the Calculate method.</p><p>So, we can use the price directly with Close[Bars-1].</p></blockquote></div><p>ok awesome that&#039;s what I thought, thanks Mr Popov! </p><p>p.s. how many indicators do I have to create to get a free copy haha <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I am running out of computers to run the demo <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-01-31T01:23:12Z</updated>
			<id>https://forexsb.com/forum/post/41242/#p41242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41241/#p41241" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Blaiserboy wrote:</cite><blockquote><p>By &#039;also is there a way to draw an indicator into the future?&#039; do you mean on the indicator chart in FSBPro..?</p><p>Ichimoku extends into the future but does not show that extension on the indicator chart.</p></blockquote></div><p>Hi Blaiserboy, yes that&#039;s what I meant. I wonder if we can trick it by subtracting a certain number from the current bar, which I think I figured out now isn&#039;t 0 but is the large number like 62777.</p><p>Oh well, doesn&#039;t matter. I don&#039;t think people use fsb to look at the charts as much as for the strategies anyway.</p><p>Can you answer any of my other questions by any chance? Oh nvm, I see Mr Popov just replied <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[jetaro]]></name>
				<uri>https://forexsb.com/forum/user/9581/</uri>
			</author>
			<updated>2017-01-31T01:20:34Z</updated>
			<id>https://forexsb.com/forum/post/41241/#p41241</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tutorial: Building Custom Indicator with FSB]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/41240/#p41240" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Is the current bar 0 or 62777?</p></blockquote></div><p>We give the data series to the indicator via the Calculate method.</p><div class="codebox"><pre><code>public override void Calculate(IDataSet dataSet)
        {
            DataSet = dataSet;</code></pre></div><p>and can use is later view the <a href="https://github.com/PopovMP/FSB_Pro_Indicators/blob/master/Infrastructure/Entities/DataSet.cs">DataSet</a> class together with all market settings.</p><p>The oldest bar in Data is 0. Te newest bar is Bars-1<br />Example.<br />Oldest close is DataSet.Close[0]<br />Newest (or current if no OOS) DataSet .Close[Bars-1]</p><p>The, DataSet is defined in the base <a href="https://github.com/PopovMP/FSB_Pro_Indicators/blob/master/Indicators/Indicator.cs">Indicator</a> class where we have also &quot;shortcuts&quot; like:</p><div class="codebox"><pre><code>        /// &lt;summary&gt;
        ///     Bar highest price
        /// &lt;/summary&gt;
        protected double[] High
        {
            get { return DataSet.High; }
        }

        /// &lt;summary&gt;
        ///     Bar lowest price
        /// &lt;/summary&gt;
        protected double[] Low
        {
            get { return DataSet.Low; }
        }

        /// &lt;summary&gt;
        ///     Bar closing price
        /// &lt;/summary&gt;
        protected double[] Close
        {
            get { return DataSet.Close; }
        }</code></pre></div><br /><p>So, we can use the price directly with Close[Bars-1].</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2017-01-31T01:18:31Z</updated>
			<id>https://forexsb.com/forum/post/41240/#p41240</id>
		</entry>
</feed>
