<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Spread limiter]]></title>
		<link>https://forexsb.com/forum/topic/3353/spread-limiter/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/3353/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Spread limiter.]]></description>
		<lastBuildDate>Tue, 04 Jun 2013 22:55:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/20215/#p20215</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Miro, if you&#039;ll convert this, make sure FST&#039;s namespace is used, it&#039;s no use in FSB.</p></blockquote></div><p>This is the reason I choose this indicator to demonstrate the new parameters.<br />As I announced earlier, all new indicators are both compatible with FSB and FST. But that doesn&#039;t mean that there is no separation in functionality.</p><p>There is a new parameter: <strong>IsBacktester</strong>. This param is equal to <strong>true</strong> when the indicator works in FSB and <strong>false</strong> when works in FST.</p><p>You can see for an example: <a href="https://github.com/PopovMP/Forex-Strategy-Builder/blob/master/Source/ForexStrategyBuilder/Indicators/Store/DateFilter.cs">DateFilter</a><br />Date filter works only in FSB. <br />I&#039;m using IsBacktester in constructor to set an warning message when indicator is started in FST.</p><div class="codebox"><pre><code>if (IsBacktester)
   WarningMessage = &quot;This indicator is designed to be used in the backtester only. It doesn&#039;t work in the trader.&quot;;</code></pre></div><p>This warning will be visible only in FST. I cannot demonstrate that because Date Filter is internally banned in FST, but everyone can use this technique in other indicator. </p><br /><p>Later, In Calculation method. I&#039;m using:</p><div class="codebox"><pre><code>if (IsBacktester)
{
    switch (IndParam.ListParam[0].Text)
    {
        case &quot;Do not open positions after&quot;:
            for (int bar = firstBar; bar &lt; Bars; bar++)
                if (Time[bar] &lt; keyDate)
                    values[bar] = 1;
            break;
        ...
    }
}
else
{
    for (int bar = firstBar; bar &lt; Bars; bar++)
        values[bar] = 1;
}</code></pre></div><p>We see that the indicator calculates signals in FSB, but sets 1s for all bars in FST (Indicator confirms both direction trade).</p><p>I&#039;ll use same format but in opposite direction for Spread Limiter:<br />- It will be available for loading in both programs.<br />- It will gives reasonable signals in FST.<br />- It will warn that is not suitable for FSB (when loaded there)<br />- It will not have any effect on backtest in FSB.<br />- It will not be used from Generator. I&#039;ll set <em>IsGeneratable = false;</em> (also new param)</p><p>Why I want to use this format:<br />1. You never know what a user will do. It may put this indicator in FSB.<br />2. It will not prevent strategy written in FST with this indicator to be loaded in FSB.<br />3. We&#039;ll have one set of indicators for all programs.</p><div class="quotebox"><blockquote><p>namespace Forex_Strategy_Trader</p></blockquote></div><p>This namespace is no longer used. We use the following namespaces for all indicators in all three programs.</p><div class="codebox"><pre><code>using System;
using ForexStrategyBuilder.Infrastructure.Entities;
using ForexStrategyBuilder.Infrastructure.Enums;
using ForexStrategyBuilder.Infrastructure.Interfaces;

namespace ForexStrategyBuilder.Indicators.Store
{
    public class DateFilter : Indicator
    {
        ...
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Tue, 04 Jun 2013 22:55:51 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/20215/#p20215</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/20211/#p20211</link>
			<description><![CDATA[<div class="quotebox"><cite>Blaiserboy wrote:</cite><blockquote><p>Wow, Footon, you have been a great contributor to FSB and FST. Thanks muchly for all you have added.</p></blockquote></div><p>Thank you, Dave! But couple of days ago you said you didn&#039;t saw my indi corner indis until recently, now you say you&#039;re seeing the spread limiter for the first time, what have you been up to, mate? <img src="https://forexsb.com/forum/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Tue, 04 Jun 2013 21:27:24 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/20211/#p20211</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/20210/#p20210</link>
			<description><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>I come here from the Feature Request forum of FSB.<br />This indicator does not make sense for FSB since FSB uses constant Spread value for the whole data series, but I can convert it in the new indicators format for FST. I&#039;ll use it&nbsp; to demonstrate some new indicator parameters.</p></blockquote></div><p>I believe the request wasn&#039;t done for FSB (the requestor is advanced user of FSB and knows it can&#039;t be achieved in FSB) but for FST. This indicator in particular is for FST. FSB won&#039;t load the indi. </p><p>Indi reads this:<br /></p><div class="codebox"><pre><code>namespace Forex_Strategy_Trader</code></pre></div><p>Miro, if you&#039;ll convert this, make sure FST&#039;s namespace is used, it&#039;s no use in FSB.</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Tue, 04 Jun 2013 21:24:29 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/20210/#p20210</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/20208/#p20208</link>
			<description><![CDATA[<p>I come here from the Feature Request forum of FSB.<br />This indicator does not make sense for FSB since FSB uses constant Spread value for the whole data series, but I can convert it in the new indicators format for FST. I&#039;ll use it&nbsp; to demonstrate some new indicator parameters.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Tue, 04 Jun 2013 21:15:00 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/20208/#p20208</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/20207/#p20207</link>
			<description><![CDATA[<p>Wow, Footon, you have been a great contributor to FSB and FST. Thanks muchly for all you have added.</p>]]></description>
			<author><![CDATA[null@example.com (Blaiserboy)]]></author>
			<pubDate>Tue, 04 Jun 2013 21:14:28 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/20207/#p20207</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/15000/#p15000</link>
			<description><![CDATA[<p>Thank you for the feedback!</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Fri, 15 Jun 2012 10:04:10 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/15000/#p15000</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14998/#p14998</link>
			<description><![CDATA[<p>footon, thank you very much for the indicator. it works perfectly well.</p>]]></description>
			<author><![CDATA[null@example.com (ldnfx)]]></author>
			<pubDate>Fri, 15 Jun 2012 05:43:03 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14998/#p14998</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14818/#p14818</link>
			<description><![CDATA[<p>sorry for that. i&#039;m now testing it on FST</p>]]></description>
			<author><![CDATA[null@example.com (ldnfx)]]></author>
			<pubDate>Thu, 07 Jun 2012 19:52:26 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14818/#p14818</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14815/#p14815</link>
			<description><![CDATA[<div class="quotebox"><cite>ldnfx wrote:</cite><blockquote><p>indi is not working. FSB doesnt see it<br /><a href="http://postimage.org/image/bdr1e98kd/"><span class="postimg"><img src="http://s14.postimage.org/bdr1e98kd/spread.jpg" alt="http://s14.postimage.org/bdr1e98kd/spread.jpg" /></span></a></p></blockquote></div><p>It is meant only for FST. It cannot be used with FSB, as in FSB spread is a constant value.</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Thu, 07 Jun 2012 17:13:26 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14815/#p14815</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14814/#p14814</link>
			<description><![CDATA[<p>indi is not working. FSB doesnt see it<br /><a href="http://postimage.org/image/bdr1e98kd/"><span class="postimg"><img src="http://s14.postimage.org/bdr1e98kd/spread.jpg" alt="http://s14.postimage.org/bdr1e98kd/spread.jpg" /></span></a></p>]]></description>
			<author><![CDATA[null@example.com (ldnfx)]]></author>
			<pubDate>Thu, 07 Jun 2012 16:11:34 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14814/#p14814</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14806/#p14806</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>increases/decreases part is very tricky</p></blockquote></div><p>The problem is that Spread is not a series of values. We have only one, current value.<br /></p><div class="codebox"><pre><code>for (int iBar = 1; iBar &lt; Bars; iBar++)
    showspread[iBar] = spread / point;</code></pre></div><p>The code above do not make it a series. It puts last Spread value in each cell of the array.</p><p>There is not&nbsp; an easy way to compare Spread values. Even we cannot compare current spread with the previous bar one.</p><p>An indicator cannot hold an array with statistics about the spread. It will be reset many times because its constructor is called in various events.</p><p>It&#039;s possible only if FST or expert collects Spread stats and indicator has access to it.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Thu, 07 Jun 2012 03:52:22 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14806/#p14806</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14805/#p14805</link>
			<description><![CDATA[<p>Ldnfx, please find the spread indi below. The first 4 logic conditions are there, increases/decreases part is very tricky for me (altough I&#039;m interested in this also), the indi should somehow &quot;remember&quot; the values which come in tick by tick and then compare them to determine increase/decrease. I believe it&#039;s achievable, but I lack the knowledge and experience of doing this.&nbsp; </p><p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Thu, 07 Jun 2012 00:03:39 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14805/#p14805</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14786/#p14786</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>I still do not understand why Spread declaration gives the context error, in the source it is declared as an instrument property next to others like Digits and Point, which both work very well.</p></blockquote></div><p><strong>Spread</strong> is not included in base class &quot;Indicator&quot; and you cannot access it directly as Digits and Point. You can use <strong>Data.InstrProperties.Spread</strong> instead.</p><p>You can use Point directly because it is declared in Indicator class:<br /></p><div class="codebox"><pre><code>protected static double Point { get { return Data.InstrProperties.Point; } }</code></pre></div><p>I&#039;ll also add the Spread in next releases like that:<br /></p><div class="codebox"><pre><code>protected static double Spread{ get { return Data.InstrProperties.Spread; } }</code></pre></div><p>You can use what is better for you:<br /> Spread gives a number as 32;<br /> Ask - Bid gives 0.00032.</p><div class="quotebox"><blockquote><p>The info panel is really not updating, if chart is opened, then maybe 2-3 times with the incoming ticks the spread changes and then it freezes</p></blockquote></div><p>Info panel updates on a new bar or when you move the mouse over the chart.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Wed, 06 Jun 2012 04:37:23 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14786/#p14786</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14782/#p14782</link>
			<description><![CDATA[<p>Alright, I got the indi working, but one issue:</p><p>The info panel is really not updating, if chart is opened, then maybe 2-3 times with the incoming ticks the spread changes and then it freezes, if tabs are toggled and chart is brought back for viewing, info panel updates. It might not be a huge problem when internally it&#039;s always up to speed to the current spread, so am I right in assuming that the indi has always the latest spread value, even though it doesn&#039;t update it in the info panel?</p><p>I still do not understand why Spread declaration gives the context error, in the source it is declared as an instrument property next to others like Digits and Point, which both work very well.</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Tue, 05 Jun 2012 19:03:24 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14782/#p14782</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spread limiter]]></title>
			<link>https://forexsb.com/forum/post/14772/#p14772</link>
			<description><![CDATA[<p>Try this way:</p><div class="codebox"><pre><code>double bid = Data.Bid;
double ask = Data.Ask;

// Calculation
double spread = ask - bid;
int firstBar = 1;

// Calculation of the logic
double[] spreads = new double[Bars];
for (int bar = firstBar; bar &lt; Bars; bar++)
     spreads[bar] = spread;</code></pre></div><p><span class="postimg"><img src="http://i.imgur.com/EkBtm.png" alt="http://i.imgur.com/EkBtm.png" /></span></p><p>Prototype is attached below.</p><p>Note: Info panel is not updated at every tick I think, but spread must be correct.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Tue, 05 Jun 2012 05:13:51 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/14772/#p14772</guid>
		</item>
	</channel>
</rss>
