<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — MT4-FST Expert v13-Beta - BreakEven corrected.]]></title>
		<link>https://forexsb.com/forum/topic/1213/mt4fst-expert-v13beta-breakeven-corrected/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/1213/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in MT4-FST Expert v13-Beta - BreakEven corrected..]]></description>
		<lastBuildDate>Wed, 16 Dec 2009 08:58:19 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[MT4-FST Expert v13-Beta - BreakEven corrected.]]></title>
			<link>https://forexsb.com/forum/post/3920/#p3920</link>
			<description><![CDATA[<p>- Bug fixed with Breakeven for a short position when the initial SL = 0;<br /> - Expert recognizes FXCM, FXOpen and ODL for late SL and TP setting with additional OrderModify().</p><p>FXOpen is questionable. I&#039;m not sure if they accept instant setting of SL and TP with OrderSend() or not. Any feed back is welcome.</p><p>The corrected BreakEven code:<br /></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_Activating_Distance)
        breakeven = BreakEven_Activating_Distance;
    else if(BreakEven_Activating_Distance &gt; 2000)
        breakeven = 2000;
    
    if (PositionType == OP_BUY)
    {
        double bid = MarketInfo(symbol, MODE_BID);
        if (bid - PositionOpenPrice &gt;= Point * breakeven)
            if (PositionStopLoss &lt; PositionOpenPrice)
                SetStopLossAndTakeProfit(symbol, PositionOpenPrice, PositionTakeProfit);
    }
    else if (PositionType == OP_SELL)
    {
        double ask = MarketInfo(symbol, MODE_ASK);
        if (PositionOpenPrice - ask &gt;= Point * breakeven)
            if (PositionStopLoss == 0 || PositionStopLoss &gt; PositionOpenPrice)
                SetStopLossAndTakeProfit(symbol, PositionOpenPrice, PositionTakeProfit);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Wed, 16 Dec 2009 08:58:19 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/3920/#p3920</guid>
		</item>
	</channel>
</rss>
