<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Using Indicator as stop loss]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/2822/" />
	<updated>2011-12-05T21:22:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/2822/using-indicator-as-stop-loss/</id>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11724/#p11724" />
			<content type="html"><![CDATA[<p>Thanks Krog!!!! <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />this is a lot to digest at once. I am sure that this will help <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> <br />I will let you know how i am progressing. if i am realy stuck i will post the code... but i like to figure it out by my self, I learn better when i do <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[dr.B]]></name>
				<uri>https://forexsb.com/forum/user/3783/</uri>
			</author>
			<updated>2011-12-05T21:22:47Z</updated>
			<id>https://forexsb.com/forum/post/11724/#p11724</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11722/#p11722" />
			<content type="html"><![CDATA[<p>Also, for more info to figure out what the Component functions do to decide out allowing long or short, here is the source:<br /><a href="https://github.com/PopovMP/Forex-Strategy-Builder/tree/master/Indicator%20base">https://github.com/PopovMP/Forex-Strate … tor%20base</a></p><p>Click on Indicator.cs, then towards the bottom it has the functions. </p><p>For built-in indicators&#039; source:<br /><a href="https://github.com/PopovMP/Forex-Strategy-Builder/tree/master/Indicators">https://github.com/PopovMP/Forex-Strate … Indicators</a></p>]]></content>
			<author>
				<name><![CDATA[krog]]></name>
				<uri>https://forexsb.com/forum/user/1692/</uri>
			</author>
			<updated>2011-12-05T19:48:49Z</updated>
			<id>https://forexsb.com/forum/post/11722/#p11722</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11721/#p11721" />
			<content type="html"><![CDATA[<p>Does it open trades in backtesting in FSB?</p><p>Is the indicator used as an Open Slot (indicator on first slot in strategy), or as an OpenFilter (Bar Opening or Bar Closing in first slot, then indicator comes after)?</p><p>Here are a few ideas to search:</p><p>Ambiguous Bars (most likely) -- sometimes the indicator gives a long and short signal at the same time in the bar. Then, FSB / FST does not open a position, it cannot decide which one. To see if you have a lot: FSB -- click the exclamation mark button (with &quot;!&quot;) in the price chart view. If you see a lot of exclamation marks over the price data, it supports this. When you mouse over, the dynamic info on the right will show:<br />Is long entry allowed&nbsp; &nbsp; Yes<br />Is short entry allowed&nbsp; &nbsp;Yes<br />Check your code separates them, or add another indicator to strategy to decide.</p><p>Repainting (somewhat likely) -- do you mean, ex, 3 previous bars say &quot;short&quot;, then when the next bar comes, the previous 3 bars change to &quot;long&quot;?<br />I have done this when I compare current bar with previous bars, then set previous bars in the indicator array to the current indicator value.<br />Ex (don&#039;t do this):<br /></p><div class="codebox"><pre><code>if (High[iBar] &gt; High[iBar-2] &amp;&amp; High[iBar] &gt; High[iBar-1]) {
   highCurrentValue = High[iBar];
}
adHighestValues[iBar] = highCurrentValue;
adHighestValues[iBar-1] = highCurrentValue;
adHighestValues[iBar-2] = highCurrentValue;</code></pre></div><p>Here, I wanted to draw a continuous line of the highest value, but it will repaint because I am setting [iBar-2] and [iBar-1] in adHighestValues (indicator array) from new info in the current bar. Be sure only setting the current bar [iBar].</p><p>Typos (somewhat likely)<br />- check do not have &quot;Enter Time&quot;, &quot;Day of Week&quot; or &quot;Enter Once&quot; slots in strategy</p><p>- Component section -- for the component with &quot;Is long entry allowed&quot;, verify DataType is AllowOpenLong, should look like:<br />Component[4].DataType = IndComponentType.AllowOpenLong;<br />same for Short</p><p>- Indicator Logic section -- verify ref Components are correct, should look like:<br />OscillatorLogic(iFirstBar, iPrvs, adHighLowOsc, 0, 0, ref Component[4], ref Component[5], IndicatorLogic.The_indicator_rises);<br />check that the numbers in brackets (4 and 5 for my example) are the same component numbers as your AllowOpenLong and AllowOpenShort components</p><p>Let me know how that goes, hope that helps</p>]]></content>
			<author>
				<name><![CDATA[krog]]></name>
				<uri>https://forexsb.com/forum/user/1692/</uri>
			</author>
			<updated>2011-12-05T19:41:16Z</updated>
			<id>https://forexsb.com/forum/post/11721/#p11721</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11718/#p11718" />
			<content type="html"><![CDATA[<p>Hi Krog<br />All your help has been great, I just spend my weekend tinkering with C#, as the result I just wrote my first program <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> ( borrowing heavily from other examples )<br />it&#039;s not much of a filter, just an exercise to see if&nbsp; I&nbsp; have grasp the logic and the basics. the FST seems to run fine&nbsp; however when i try to test it on FST it loads ok but&nbsp; it fails to open a position .&nbsp; The&nbsp; behavior shows &quot;repainting &quot;of Short allowed or Long allowed , I can&#039;t figure it out... any thoughts?<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[dr.B]]></name>
				<uri>https://forexsb.com/forum/user/3783/</uri>
			</author>
			<updated>2011-12-05T08:10:11Z</updated>
			<id>https://forexsb.com/forum/post/11718/#p11718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11713/#p11713" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>krog wrote:</cite><blockquote><p>My first guess, you have &#039;Bar&#039; with a capital B. It looks like you are trying to get the bar number -- try &#039;iBar&#039; instead. It should match what&#039;s in the for loop, for Ross Hook:<br /></p><div class="codebox"><pre><code>for (int iBar = 5; iBar &lt; Bars - 1; iBar++)</code></pre></div><p>Also, be sure you are in the for loop -- from the curly brace ({) just after to the closing curly brace (}) at the same indentation. If you are outside, you will get an error message like &quot; &#039;iBar&#039; is not defined in this scope&quot;, or something about not defined.</p><p>Let me know if that works, if not paste the for-loop code you have and I&#039;ll take a look.</p><p>thanks<br />krog</p></blockquote></div><br /><p>yup that did it<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[dr.B]]></name>
				<uri>https://forexsb.com/forum/user/3783/</uri>
			</author>
			<updated>2011-12-04T08:03:17Z</updated>
			<id>https://forexsb.com/forum/post/11713/#p11713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11695/#p11695" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>dr.B wrote:</cite><blockquote><p>Hi Krog <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />I see... hmm&nbsp; i guess one can always shift the indicator up or down to get the same effect and then use it as a closing ind. <br />Q. <br />I was trying to set a tracer as u described&nbsp; for the Ross Hook Ind, and got this error from&nbsp; FSB<br />Line 76 Column 29: &#039;Forex_Strategy_Builder.Bar&#039; is a &#039;type&#039; but is used like a &#039;variable&#039;.<br />I assume that i have to define the tracer somewhere as a variable how and where do i do that?<br />Thanks</p></blockquote></div><p>My first guess, you have &#039;Bar&#039; with a capital B. It looks like you are trying to get the bar number -- try &#039;iBar&#039; instead. It should match what&#039;s in the for loop, for Ross Hook:<br /></p><div class="codebox"><pre><code>for (int iBar = 5; iBar &lt; Bars - 1; iBar++)</code></pre></div><p>Also, be sure you are in the for loop -- from the curly brace ({) just after to the closing curly brace (}) at the same indentation. If you are outside, you will get an error message like &quot; &#039;iBar&#039; is not defined in this scope&quot;, or something about not defined.</p><p>Let me know if that works, if not paste the for-loop code you have and I&#039;ll take a look.</p><p>thanks<br />krog</p>]]></content>
			<author>
				<name><![CDATA[krog]]></name>
				<uri>https://forexsb.com/forum/user/1692/</uri>
			</author>
			<updated>2011-12-01T23:22:33Z</updated>
			<id>https://forexsb.com/forum/post/11695/#p11695</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11694/#p11694" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>krog wrote:</cite><blockquote><p>It is not possible to make an indicator as a stop for a specific position; indicators do not have information about positions. It has to be coded into FSB, then has to be coded into FST. If the indicator is used a stop, the value changes with the indicator, so then becomes a closing indicator.</p></blockquote></div><p>Hi Krog <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />I see... hmm&nbsp; i guess one can always shift the indicator up or down to get the same effect and then use it as a closing ind. <br />Q. <br />I was trying to set a tracer as u described&nbsp; for the Ross Hook Ind, and got this error from&nbsp; FSB<br />Line 76 Column 29: &#039;Forex_Strategy_Builder.Bar&#039; is a &#039;type&#039; but is used like a &#039;variable&#039;.<br />I assume that i have to define the tracer somewhere as a variable how and where do i do that?<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[dr.B]]></name>
				<uri>https://forexsb.com/forum/user/3783/</uri>
			</author>
			<updated>2011-12-01T22:21:18Z</updated>
			<id>https://forexsb.com/forum/post/11694/#p11694</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11691/#p11691" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>dr.B wrote:</cite><blockquote><p>Thanks Krog for all this work again <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I will have to play with this to fully understand it<br />when i look at coding, i tend to follow the logic but the structure or the grammar of it is just eluding me (for now) <br />i will try not to ask for too much of your time, as it seems like you are helping everyone... i like the Gann project you are working on, it looks promising. <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />one question,&nbsp; is it possible to set the a stop loss to an indicator value?&nbsp; what i have in mind is to use Ross Hook value as a sl and add extra few pips for protection</p></blockquote></div><p>Hi dr.B,<br />Please feel free to ask, I&#039;m happy to help people to be able to code.</p><p>It is not possible to make an indicator as a stop for a specific position; indicators do not have information about positions. It has to be coded into FSB, then has to be coded into FST. If the indicator is used a stop, the value changes with the indicator, so then becomes a closing indicator.</p>]]></content>
			<author>
				<name><![CDATA[krog]]></name>
				<uri>https://forexsb.com/forum/user/1692/</uri>
			</author>
			<updated>2011-12-01T19:01:47Z</updated>
			<id>https://forexsb.com/forum/post/11691/#p11691</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11689/#p11689" />
			<content type="html"><![CDATA[<p>(moved from Tracing Techniques)</p>]]></content>
			<author>
				<name><![CDATA[krog]]></name>
				<uri>https://forexsb.com/forum/user/1692/</uri>
			</author>
			<updated>2011-12-01T18:35:50Z</updated>
			<id>https://forexsb.com/forum/post/11689/#p11689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Using Indicator as stop loss]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11690/#p11690" />
			<content type="html"><![CDATA[<p>Thanks Krog for all this work again <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I will have to play with this to fully understand it<br />when i look at coding, i tend to follow the logic but the structure or the grammar of it is just eluding me (for now) <br />i will try not to ask for too much of your time, as it seems like you are helping everyone... i like the Gann project you are working on, it looks promising. <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />one question,&nbsp; is it possible to set the a stop loss to an indicator value?&nbsp; what i have in mind is to use Ross Hook value as a sl and add extra few pips for protection</p>]]></content>
			<author>
				<name><![CDATA[dr.B]]></name>
				<uri>https://forexsb.com/forum/user/3783/</uri>
			</author>
			<updated>2011-12-01T10:22:21Z</updated>
			<id>https://forexsb.com/forum/post/11690/#p11690</id>
		</entry>
</feed>
