<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Help on a strategy]]></title>
		<link>https://forexsb.com/forum/topic/1838/help-on-a-strategy/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/1838/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Help on a strategy.]]></description>
		<lastBuildDate>Wed, 27 Oct 2010 07:09:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7094/#p7094</link>
			<description><![CDATA[<p>Hi footon,</p><p>Can you please post what I should do to correct the above problem of sending traded history by mail as I am a new commer to Mt4.</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (powerstar)]]></author>
			<pubDate>Wed, 27 Oct 2010 07:09:47 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7094/#p7094</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7033/#p7033</link>
			<description><![CDATA[<p>Thanks Again,&nbsp; I think I got it</p>]]></description>
			<author><![CDATA[null@example.com (cruzsurfn)]]></author>
			<pubDate>Wed, 20 Oct 2010 18:37:37 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7033/#p7033</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7032/#p7032</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>what am I replacing it with?</p></blockquote></div><p>Replace the whole function <br />void SetBreakEvenStop(string symbol)<br />with the code shown below.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Wed, 20 Oct 2010 18:10:52 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7032/#p7032</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7030/#p7030</link>
			<description><![CDATA[<p>Popov,&nbsp; Thanks for all the help and for all the great work!!&nbsp; &nbsp; </p><p>I am a little confused though..<br />When you say <br />&quot;After that find the &quot;void SetBreakEvenStop(string symbol)&quot; function on line 1031 and replace it with that one:&quot;</p><p>what am I replacing it with?</p><p>Thanks again..&nbsp; &nbsp; <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 (cruzsurfn)]]></author>
			<pubDate>Wed, 20 Oct 2010 16:30:44 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7030/#p7030</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7024/#p7024</link>
			<description><![CDATA[<p>Hi,</p><p>Here is the coding, please note not only the date is not functioning, the price details and the profits are also not updating.</p><p>Thanks</p><p>//+------------------------------------------------------------------+<br />//|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MailAlert TEST.mq4 |<br />//|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Nicholishen |<br />//|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />//+------------------------------------------------------------------+<br />//http://www.forex-tsd.com/metatrader-4/1125-code-send-email-alerts-when-closed-trades.html<br />#property copyright &quot;Nicholishen&quot;<br />#property link&nbsp; &nbsp; &nbsp; &quot;&quot;<br />int k;<br />//+------------------------------------------------------------------+<br />//| expert initialization function&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />//+------------------------------------------------------------------+<br />int init()<br />&nbsp; {<br />for(int i=0;i&lt;1000;i++){<br />&nbsp; &nbsp; &nbsp; if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(OrderSymbol()==Symbol()&nbsp; ){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; }else{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br />&nbsp; &nbsp; &nbsp; }&nbsp; <br />&nbsp; &nbsp;}<br />&nbsp; &nbsp;Comment(&quot;Init() Trades Count = &quot;,k);<br />&nbsp; &nbsp;return(0);<br />&nbsp; }<br />//+------------------------------------------------------------------+<br />//| expert deinitialization function&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />//+------------------------------------------------------------------+<br />int deinit()<br />&nbsp; {<br />//----<br />&nbsp; &nbsp;<br />//----<br />&nbsp; &nbsp;return(0);<br />&nbsp; }<br />//+------------------------------------------------------------------+<br />//| expert start function&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />//+------------------------------------------------------------------+<br />int start()<br />&nbsp; {<br />//----</p><p>int f =0;<br />&nbsp; &nbsp;for(int i=0;i&lt;10000;i++){<br />&nbsp; &nbsp; &nbsp; if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(OrderSymbol()==Symbol() /*&amp;&amp; OrderMagicNumber()==MAGICMA &amp;&amp; OrderComment() ==Cmt(Period())*/ ){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp; &nbsp; }else{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br />&nbsp; &nbsp; &nbsp; }&nbsp; <br />&nbsp; &nbsp;}<br />&nbsp; &nbsp;Comment(&quot; Trades in History &quot;,f,&quot; Init cnt &quot;,k&nbsp; );<br />&nbsp; &nbsp;if(k &lt; f){<br />&nbsp; &nbsp; &nbsp; string ordertyp;<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; OrderSelect(f,SELECT_BY_POS,MODE_HISTORY);<br />&nbsp; &nbsp; &nbsp; if(OrderType()==0)ordertyp=&quot;BUY&quot;;<br />&nbsp; &nbsp; &nbsp; if(OrderType()==1)ordertyp=&quot;SELL&quot;;<br />&nbsp; &nbsp; &nbsp;// SendMail(&quot;HI&quot;,&quot;HI&quot;);<br />&nbsp; &nbsp; &nbsp; SendMail(&quot;CLOSED TRADE&quot;,&quot;&nbsp; &quot;+Symbol()+&quot;&nbsp; &nbsp; OpenTime: &quot;+TimeToStr(OrderOpenTime())+&quot;&nbsp; &nbsp;Close Time: &quot;+TimeToStr(OrderCloseTime())+&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;+<br />&nbsp; &nbsp; &nbsp; &quot;Order Type &quot;+ordertyp+&quot;&nbsp; &nbsp;Open &quot;+DoubleToStr(OrderOpenPrice(),4)+&quot;&nbsp; &nbsp;Close &quot;+DoubleToStr(OrderClosePrice(),4)+&quot;&nbsp; Profit (&quot;+DoubleToStr(OrderProfit(),4)+&quot;)&quot; );<br />&nbsp; &nbsp; &nbsp; k++;<br />&nbsp; &nbsp;}<br /> return;<br />} </p><br /><p>//----<br />&nbsp; <br />//+------------------------------------------------------------------+</p>]]></description>
			<author><![CDATA[null@example.com (powerstar)]]></author>
			<pubDate>Wed, 20 Oct 2010 06:12:36 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7024/#p7024</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7018/#p7018</link>
			<description><![CDATA[<div class="quotebox"><cite>powerstar wrote:</cite><blockquote><p>GBPUSD&nbsp; &nbsp; OpenTime: 1970.01.01 00:00&nbsp; &nbsp;Close Time: 1970.01.01 00:00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />Order Type BUY&nbsp; &nbsp;Open 0.0000&nbsp; &nbsp;Close 0.0000&nbsp; Profit (0.0000)</p><p>Thank you</p></blockquote></div><p>Just a guess (without actually looking at any of the code) but it looks like the variables for passing the time and order info are not being set. The 1970 date is like the default for time objects.</p>]]></description>
			<author><![CDATA[null@example.com (krog)]]></author>
			<pubDate>Tue, 19 Oct 2010 18:20:26 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7018/#p7018</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7011/#p7011</link>
			<description><![CDATA[<p>Hi,<br />Many thanks for finding that EA for me. I tried it on demo and it actually send the mail alert but the contents are not filled and all zero. It gives a date with the year 1970 and I do not know from where it is fetching the year 1970. My computer date is correct as well as the metatrader explorer have been changed. Here is the sample message which I received on my hand phone.</p><p>GBPUSD&nbsp; &nbsp; OpenTime: 1970.01.01 00:00&nbsp; &nbsp;Close Time: 1970.01.01 00:00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />Order Type BUY&nbsp; &nbsp;Open 0.0000&nbsp; &nbsp;Close 0.0000&nbsp; Profit (0.0000)</p><p>I would appreciate if you could kindly check this and let me know.</p><p>On the other hand if there is a drop down item in the FSB ( forex Stratergy Builder) which could be inserted easily in to the EA would be very attractive. Can you please suggest this point to the owner please.</p><p>Thank you</p>]]></description>
			<author><![CDATA[null@example.com (powerstar)]]></author>
			<pubDate>Tue, 19 Oct 2010 11:51:48 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7011/#p7011</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7005/#p7005</link>
			<description><![CDATA[<p>Here is how to make Break Even closing on several points profit. </p><p>Find the &quot;External variables&quot; section on line 80 and add this external variable:<br /></p><div class="codebox"><pre><code>extern int Break_Even_Shift = 5;</code></pre></div><p>It will be visible when starting the expert and you can set the Break Even shift in points. The default is 5, but you can change it.</p><p>After that find the &quot;void SetBreakEvenStop(string symbol)&quot; function on line 1031 and replace it with that one:</p><p> </p><div class="codebox"><pre><code>///
/// Sets a BreakEven stop of current positions. 
/// 
void SetBreakEvenStop(string symbol)
{
    if (SetAggregatePosition(symbol) &lt;= 0)
        return;

    double breakeven = MarketInfo(symbol, MODE_STOPLEVEL);
    if (breakeven &lt; BreakEven)
        breakeven = BreakEven;
        
    double breakprice = 0; // Break Even price including commission.   
    double commission = 0; // Commission in pips.
    if (PositionCommission != 0)
        commission = MathAbs(PositionCommission) / MarketInfo(symbol, MODE_TICKVALUE);
        
    double point  = MarketInfo(symbol, MODE_POINT);
    double digits = MarketInfo(symbol, MODE_DIGITS);
    
    if (PositionType == OP_BUY)
    {
        double bid = MarketInfo(symbol, MODE_BID);
        breakprice = NormalizeDouble(PositionOpenPrice + point * Break_Even_Shift + point * commission / PositionLots, digits);
        if (bid - breakprice &gt;= point * breakeven)
            if (PositionStopLoss &lt; breakprice)
            {
                SetStopLossAndTakeProfit(symbol, breakprice, PositionTakeProfit);
                Print(&quot;Break Even (&quot;, BreakEven, &quot; pips) set Stop Loss to &quot;,  breakprice, &quot;, Bid = &quot;, bid);
            }
    }
    else if (PositionType == OP_SELL)
    {
        double ask = MarketInfo(symbol, MODE_ASK);
        breakprice = NormalizeDouble(PositionOpenPrice - point * Break_Even_Shift - point * commission / PositionLots, digits);
        if (breakprice - ask &gt;= point * breakeven)
            if (PositionStopLoss == 0 || PositionStopLoss &gt; breakprice)
            {
                SetStopLossAndTakeProfit(symbol, breakprice, PositionTakeProfit);
                Print(&quot;Break Even (&quot;, BreakEven, &quot; pips) set Stop Loss to &quot;,  breakprice, &quot;, Ask = &quot;, ask);
            }
    }
}</code></pre></div><p>There are two modifications only. For long position:<br /></p><div class="codebox"><pre><code>breakprice = NormalizeDouble(PositionOpenPrice + point * commission / PositionLots, digits);
changed to:
breakprice = NormalizeDouble(PositionOpenPrice + point * Break_Even_Shift + point * commission / PositionLots, digits);</code></pre></div><p>And for short position:<br /></p><div class="codebox"><pre><code>breakprice = NormalizeDouble(PositionOpenPrice - point * commission / PositionLots, digits);
changed to:
breakprice = NormalizeDouble(PositionOpenPrice - point * Break_Even_Shift - point * commission / PositionLots, digits);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Tue, 19 Oct 2010 05:23:40 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7005/#p7005</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/7002/#p7002</link>
			<description><![CDATA[<p>Thanks Footon,&nbsp; &nbsp; I think it would be great if that were an option,&nbsp; I was also wondering if there were an option for the trailing stop to start trailing in profit only,&nbsp; to lock in some kind of profit instead of slipping into negative territory...</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (cruzsurfn)]]></author>
			<pubDate>Mon, 18 Oct 2010 23:11:05 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/7002/#p7002</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6984/#p6984</link>
			<description><![CDATA[<p>Is there a way to change the break even so that it stops at a 2 to 3 pip positive position</p>]]></description>
			<author><![CDATA[null@example.com (cruzsurfn)]]></author>
			<pubDate>Mon, 18 Oct 2010 15:18:42 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6984/#p6984</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6973/#p6973</link>
			<description><![CDATA[<p>Yes thanks for that but the broker says that the EA must include the e-mail alert instructions. So how do we include the e-mail instructions to the EA via the Forex Stratergy Builder ? This is the problem.</p><p>Many thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (powerstar)]]></author>
			<pubDate>Mon, 18 Oct 2010 01:56:26 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6973/#p6973</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6965/#p6965</link>
			<description><![CDATA[<p>Hi,</p><p>How can I set a trade alert for me to receive an e-mail or SMS on details of trades done whenever there is a trade either open or close ?</p><p>Thanks</p><p>Yes thanks for that but the broker says that the EA must include the e-mail alert instructions. So how do we include the e-mail instructions to the EA via the Forex Stratergy Builder ? This is the problem.</p><p>Many thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (powerstar)]]></author>
			<pubDate>Sat, 16 Oct 2010 23:44:12 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6965/#p6965</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6958/#p6958</link>
			<description><![CDATA[<p>hello.i am new here.i would like to have a indicator to buy if moving avg(5 day,simple)crosses (7 day,expo).<br />pls,help</p>]]></description>
			<author><![CDATA[null@example.com (picovishnu)]]></author>
			<pubDate>Sat, 16 Oct 2010 11:14:46 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6958/#p6958</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6783/#p6783</link>
			<description><![CDATA[<p>Thank you very much for the custom indicator. I have placed it under the custom indicators folder and it is showing up for the opening logic condition. But for the closing logic condition it is not showing up. Do I have to save it in any other folders?</p><p>Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (padala123)]]></author>
			<pubDate>Mon, 04 Oct 2010 19:45:37 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6783/#p6783</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help on a strategy]]></title>
			<link>https://forexsb.com/forum/post/6777/#p6777</link>
			<description><![CDATA[<p>This version of the indicator applies the &quot;Use previous bar value&quot; option correctly.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Mon, 04 Oct 2010 05:23:03 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/6777/#p6777</guid>
		</item>
	</channel>
</rss>
