<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2489175859740167749</id><updated>2011-11-27T15:27:35.080-08:00</updated><category term='Privacy Policy'/><category term='Metatrader broker'/><title type='text'>Forex Automated Trading</title><subtitle type='html'>Expert Advisor open source to use as template which you can use to create your own automated Forex system.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-1424027798095253042</id><published>2008-09-01T08:40:00.001-07:00</published><updated>2010-06-01T10:02:33.965-07:00</updated><title type='text'>Check for Signals: The core of your system</title><content type='html'>&lt;br&gt;&lt;br&gt;This loop, in the code named CheckForSignal() es used to get the singal for open or close a trade.&lt;br /&gt;&lt;br /&gt;The loop return the value of two bools, signalBuy and signalSell.&lt;br /&gt;The result of this bools will be used to open or close positions.&lt;br /&gt;Let going to see the example of the Expert Advisor CyberEA-Template.&lt;br /&gt;&lt;br /&gt;In the template if &lt;code&gt;signalBuy=true&lt;/code&gt; is a buy signal and if &lt;code&gt;signalSell=true&lt;/code&gt; is a sell signal.&lt;br /&gt;&lt;br /&gt;CyberEA gets the value of slowMA (Slow MA) and fastMA (Fast MA) and if &lt;code&gt;fastMA&gt;slowMA&lt;/code&gt; return signalBuy=true so, a buy signal.&lt;br /&gt;This value will be called from check for open and check for close loops, wich we will see in other post, to take action.&lt;br /&gt;&lt;br /&gt;Note that the settings of MA are selected from external variables that can be changed after compilation of the code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;void BuscarSenal()&lt;br /&gt;{&lt;br /&gt;if (time_now != Time[0])&lt;br /&gt; {&lt;br /&gt; time_now = Time[0];&lt;br /&gt; slowMA = iMA(NULL,0,SlowMAPeriod,SlowMAShift,SlowMAMode,SlowMAApplyPrice,Bar);&lt;br /&gt; fastMA = iMA(NULL,0,FastMAPeriod,FastMAShift,FastMAMode,FastMAApplyPrice,Bar);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;signalSell = false;&lt;br /&gt;signalBuy = false;&lt;br /&gt;if (fastMA&gt;slowMA) signalBuy = true;&lt;br /&gt;if (slowMA&gt;fastMA) signalSell=true;&lt;br /&gt;goLong = signalBuy;&lt;br /&gt;goShort = signalSell;&lt;br /&gt;if (goLong || goShort) return;&lt;br /&gt;&lt;br /&gt;if (BuscarOrdenes() != 0)&lt;br /&gt; {&lt;br /&gt; goLong = false;&lt;br /&gt; goShort = false;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-1424027798095253042?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/1424027798095253042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=1424027798095253042' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1424027798095253042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1424027798095253042'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/09/check-for.html' title='Check for Signals: The core of your system'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-3718459078640525490</id><published>2008-08-22T09:16:00.000-07:00</published><updated>2010-06-01T10:05:14.986-07:00</updated><title type='text'>Money Management Tool</title><content type='html'>&lt;br&gt;&lt;br&gt;CyberEA Template has a money management tool integrated. This tool get the lot size for the positions based on risk and stop loss settings.&lt;br /&gt;Extenal variables of MoneyManagement tool:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; UseMoneyManagement: Set to true if you want to use automatic calculation of lot size.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; UseMicroLots: Set to true if you are going to trade in 0.01 lots steps. IMPORTANT: Set it to true when you trade in 0.01 step, even if you set UseMoneyManagement=false.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; MaximumRisk: Enter your max. risk. Example: 5 mean you accept a loss of 5% of your account per trade.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; FixedLots: Enter the number of lots per trade when UseMoneyManagement=false.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;How stoploss affects to automatic calculation of lot size?&lt;br /&gt;I will explain with an example.&lt;br /&gt;&lt;br /&gt;If you set an stoploss of 150 pips and a MaximumRisk=5, this mean that if stoploss is hitted the max. loss will be 5% of your balance and the lot size will be calculated based on this. So if you set stoploss of 50 pips the lot size will be greater than if you set 150pips stop loss for the same max risk.&lt;br /&gt;&lt;br /&gt;The MoneyManegement code: The loop is a double function that must be called when you need calculated the lot size, for example in OrderSend function you have to write LotsRisk(int sl) instead a number of lots. In our case we set the stop loss with the variable StopLoss so we have to write LotsRisk(StopLoss) when lot size calculation is needed.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;double LotsRisk(int sl)&lt;br /&gt;{&lt;br /&gt;if (UseMicroLots == false)&lt;br /&gt; {&lt;br /&gt; if (!UseMoneyManagement)&lt;br /&gt;    {&lt;br /&gt;    LotSize = NormalizeDouble(FixedLots,1);&lt;br /&gt;    if (LotSize &lt; 0.1) LotSize = 0.1;&lt;br /&gt;    if (Kumo == 1) Print("Position lot size: " + LotSize);&lt;br /&gt;    }&lt;br /&gt; if (UseMoneyManagement)&lt;br /&gt;    {&lt;br /&gt;    LotSize = NormalizeDouble(AccountFreeMargin() * MaximumRisk / 1000.0 / sl,1);&lt;br /&gt;    if (LotSize &lt; 0.1) LotSize = 0.1;&lt;br /&gt;    if (Kumo == 1) Print("Position lot size: " + LotSize);&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;if (UseMicroLots == true)&lt;br /&gt; {&lt;br /&gt; if (!UseMoneyManagement)&lt;br /&gt;    {&lt;br /&gt;    LotSize = NormalizeDouble(FixedLots,2);&lt;br /&gt;    if (LotSize &lt; 0.01) LotSize = 0.01;&lt;br /&gt;    if (Kumo == 1) Print("Position lot size: " + LotSize);&lt;br /&gt;    }&lt;br /&gt; if (UseMoneyManagement)&lt;br /&gt;    {&lt;br /&gt;    LotSize = NormalizeDouble(AccountFreeMargin() * MaximumRisk / 1000.0 / sl,2);&lt;br /&gt;    if (LotSize &lt; 0.01) LotSize = 0.01;&lt;br /&gt;    if (Kumo == 1) Print("Position lot size: " + LotSize);&lt;br /&gt;    }&lt;br /&gt; }&lt;br /&gt;return(LotSize);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-3718459078640525490?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/3718459078640525490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=3718459078640525490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3718459078640525490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3718459078640525490'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/08/money-management-tool.html' title='Money Management Tool'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-2260803958282945401</id><published>2008-07-24T08:38:00.000-07:00</published><updated>2008-07-24T08:59:41.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Metatrader broker'/><title type='text'>LiteForex Metatrader Broker</title><content type='html'>&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;a href="http://www.liteforex.org/default.php?uid=900001081" target="_blank"&gt;&lt;font color="#00ffff"&gt;LiteForex&lt;/font&gt;&lt;/a&gt; is a Metatrader Forex Broker that support accounts in cents, so is one of the best for testing Expert Advisor with just 1 or 5 five dollars.&lt;/p&gt;&lt;p&gt; &lt;a href="http://www.liteforex.org/default.php?uid=900001081" target="_blank"&gt;&lt;font color="#00ffff"&gt;LiteForex&lt;/font&gt;&lt;/a&gt; has a minimum deposit of 1$ and you can use a lot of ways to funds your account.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.liteforex.org/default.php?uid=900001081" target="_blank"&gt;&lt;font color="#00ffff"&gt;Visit LiteForex&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;You can start to trade with a little 1$.&lt;/li&gt;&lt;li&gt;Spreads: 3 pips on EUR/USD and 4 on GBP/USD.&lt;/li&gt;&lt;li&gt;Stocks and metals available for trade&lt;/li&gt;&lt;li&gt;Demo accounts for practice purpose.&lt;/li&gt;&lt;li&gt;Monthly interest over the balance directly on your account.&lt;/li&gt;&lt;li&gt;Daily analisis and news alerts sevice.&lt;/li&gt;&lt;li&gt;3 dedicated servers.&lt;/li&gt;&lt;li&gt;Metatrader trading platform.&lt;/li&gt;&lt;li&gt;Leverage: 1:100 or 1:200.&lt;/li&gt;&lt;li&gt;Make a fund on your account or withdraw through wire tranfer, WebMoney, MoneyBookers, e-Bullion, USD credit card, etc.&lt;/li&gt;&lt;li&gt;Fast execution, no dealing desk.&lt;/li&gt;&lt;li&gt;Part of Straighthold Investment Group, independent Market Maker.&lt;/li&gt;&lt;li&gt;Regulated by International Business Authority of Seychelles, reference ID 036925.&lt;/li&gt;&lt;li&gt;On line since 2004.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;p&gt;&lt;center&gt;&lt;span style="color:#00FFF;font-size:20px;"&gt;&lt;a href="http://www.liteforex.org/default.php?uid=900001081" target="_blank"&gt;&lt;font color="#00ffff"&gt;Visit LiteForex&lt;/font&gt;&lt;/a&gt; - &lt;a href="http://www.liteforex.org/openaccount.php?uid=900001081" target="_blank"&gt;&lt;font color="#00ffff"&gt;Open an account with LiteForex&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;/center&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-2260803958282945401?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/2260803958282945401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=2260803958282945401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/2260803958282945401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/2260803958282945401'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/07/liteforex-metatrader-broker.html' title='LiteForex Metatrader Broker'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-1951182160351312504</id><published>2008-07-20T16:35:00.000-07:00</published><updated>2008-07-24T08:59:28.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Metatrader broker'/><title type='text'>InstaForex, Metatrader Forex Broker</title><content type='html'>&lt;br&gt;&lt;p&gt;&lt;a href="http://instaforex.com/index.php?x=MY" target="_blank"&gt;InstaForex&lt;/a&gt;,  Metatrader Forex Broker.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Minimum deposit: 10$&lt;/li&gt;&lt;li&gt;Leverage: from 1:1 to 1 :500&lt;/li&gt;&lt;li&gt;Minimum lot size: 0.01&lt;/li&gt;&lt;li&gt;Spreads: 3 pips on EUR/USD, GBP/USD, USD/CHF and USD/JPY&lt;/li&gt;&lt;li&gt;32 currencies crosses and CFD's&lt;/li&gt;&lt;li&gt;Accounts with zero spreads available, you will pay a 0.02-0.07% comission per trade&lt;/li&gt;&lt;li&gt;On line since 2008&lt;/li&gt;&lt;li&gt;6% annual interest rate on deposit&lt;/li&gt;&lt;li&gt;Deposit via Paypal, wire transfer, credit card, e-gold, WebMoney, e-Bullion and RuPay&lt;/li&gt;&lt;/ul&gt;&lt;center&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color:#00FFF;font-size:20px;"&gt;&lt;a href="http://instaforex.com/index.php?x=MY" target="_blank"&gt;Visit InstaForex&lt;/a&gt; - &lt;a href="http://instaforex.com/open_live_account.php?x=MY" target="_blank"&gt;Open an account with InstaForex&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-1951182160351312504?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/1951182160351312504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=1951182160351312504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1951182160351312504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1951182160351312504'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/07/instaforex-metatrader-forex-broker.html' title='InstaForex, Metatrader Forex Broker'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-2213638068025923014</id><published>2008-07-14T03:38:00.000-07:00</published><updated>2008-07-14T04:31:58.534-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Metatrader broker'/><title type='text'>FXCast Metatrader Forex Broker</title><content type='html'>&lt;ul&gt;&lt;li&gt;Minimum deposit: 10USD&lt;/li&gt;&lt;li&gt;Leverage from 1:25 to 1:400.&lt;/li&gt;&lt;li&gt;Minimum lot per trade: 0.01.&lt;/li&gt;&lt;li&gt;Spreads: 3 pips in EUR/USD and GBP/USD.&lt;/li&gt;&lt;li&gt;Demo accounts available.&lt;/li&gt;&lt;li&gt;Customer supprot 24 hours per day.&lt;/li&gt;&lt;li&gt;On line since 2005.&lt;/li&gt;&lt;li&gt;Trading platform: &lt;b&gt;Metatrader&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Funds and withdraws through wire transfer, credit card, e-bullion, e-gold, c-gold, webmoney, liberty reserve and e-dinar .&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;center&gt;&lt;span style="color:#00FFFF;font-size:20px;"&gt;&lt;a href="http://fxcast.com/?pr=20508" target="_blank"&gt;Visit FXCast&lt;/a&gt; - &lt;a href="https://fxcast.com/Open_Account.php?real?pr=20508" target="_blank"&gt;Open an account with FXCast&lt;/a&gt;&lt;/span&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-2213638068025923014?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/2213638068025923014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=2213638068025923014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/2213638068025923014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/2213638068025923014'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/07/fxcast-metatrader-forex-broker.html' title='FXCast Metatrader Forex Broker'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-7462167410944727817</id><published>2008-05-15T14:18:00.000-07:00</published><updated>2010-06-01T10:08:54.715-07:00</updated><title type='text'>Start() function</title><content type='html'>&lt;br&gt;&lt;br&gt;The start() is the only one that is needed in order to work. This function is executed every tick is recieved in Metatrader. So you must set in this function all parameters and variables that have to be calculate at each tick and call the others functions based on it.&lt;br /&gt;In CyberEA-Template, all function calls is envolved into trading hours variables.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;void start(){&lt;br /&gt;First piece of code of the loop: check for trade stratus and trade context:&lt;br /&gt;bool tradeallowed=IsTradeAllowed();&lt;br /&gt;if(!tradeallowed){&lt;br /&gt;Print("Trade not allowed");&lt;br /&gt;}&lt;br /&gt;bool contextbusy=IsTradeContextBusy();&lt;br /&gt;if (contextbusy){&lt;br /&gt;Print("Trade context is busy");&lt;br /&gt;}&lt;br /&gt; Next part:   On each tick CyberEA take the current time as value of the local variable named hour. Based on the value of hour we set the next action. On this way, if it's time to trade (we are set the trading hours in the external varialbes) . In this way if hour is equal to expiration hour the function Clean() (for close all orders) is called. If hour is between start and end hour the function CheckForSignal() (check for signal) is called. Also is called the function SearhPositions() (check for orders) and if SearchPositons() is not equal to zero the EA will call CheckForClose() (check for close). If SearchPositions() is equal to zero CheckForOpen() function (check for open) is called. Also I have to comment that TrailStop and BreakEven function will be called only if hour is between trading hours and if we have set it to true in the external variables. &lt;br /&gt;int hour = Hour(); if (hour == Expiration) Clean(); if ((StartHour &lt;= hour) &amp;amp;&amp;amp; (EndHour &gt;= hour)) {&lt;br /&gt;CheckForSignal();&lt;br /&gt;if (SearchPositions() != 0)&lt;br /&gt;CheckForClose(); else CheckForOpen();&lt;br /&gt;if (SearchPositions() != 0) {&lt;br /&gt;if (UseTrailingStop == true) TrailStop();&lt;br /&gt;if (UseBreakEven == true) BreakEven();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Commenting(); Commenting function is called on each tick.&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-7462167410944727817?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/7462167410944727817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=7462167410944727817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/7462167410944727817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/7462167410944727817'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/05/start-function.html' title='Start() function'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-3134622828582723820</id><published>2008-05-14T13:36:00.000-07:00</published><updated>2010-06-01T10:10:14.461-07:00</updated><title type='text'>Head and global variables</title><content type='html'>&lt;br&gt;&lt;br&gt;Head and global vaiables are the first piece of code of the expert advisor where you must set the copyright information, the variables that you are going to use in some functions and the externs variables that you are going to use in some functions and you want to be able for after compile changes.&lt;br /&gt;&lt;br /&gt;Let go to comment this piece of code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Head with copyright information:&lt;br /&gt;#property copyright "Copyright 2008, &lt;a href="http://cablebot.blogspot.com/"&gt;http://cablebot.blogspot.com/&lt;/a&gt;"&lt;br /&gt;#property link "&lt;a href="http://cablebot.blogspot.com/"&gt;http://cablebot.blogspot.com/&lt;/a&gt;"&lt;br /&gt;&lt;br /&gt;stdlib library call:&lt;br /&gt;#include &amp;lt;stdlib.mqh&amp;gt;&lt;br /&gt;&lt;br /&gt;external variables:&lt;br /&gt;extern string Version = "CyberEA"; This is a comment asociate to all orders open by this expert advisor. This comment can be used to identify all orders from the EA.&lt;br /&gt;extern string Settings="Settings"; Here start the external variables that you can chage in the experts properties window at the time of use. Set the default values before compile.&lt;br /&gt;&lt;br /&gt;Trading hours:&lt;br /&gt;extern int StartHour = 0;&lt;br /&gt;extern int EndHour = 24;&lt;br /&gt;extern int Expiration = 24;&lt;br /&gt;&lt;br /&gt;Slippage:&lt;br /&gt;extern int Slippage = 5;&lt;br /&gt;&lt;br /&gt;Order take profit and stoploss:&lt;br /&gt;extern double TakeProfit =450;&lt;br /&gt;extern double StopLoss = 150;&lt;br /&gt;&lt;br /&gt;Trainling stop:&lt;br /&gt;extern bool UseTrailingStop = false;&lt;br /&gt;extern int TrailingStart = 80;&lt;br /&gt;extern int TrailingStop =100;&lt;br /&gt;&lt;br /&gt;BreakEven or Profit Protect variables:&lt;br /&gt;extern bool UseBreakEven = false;&lt;br /&gt;extern int ProfitProtectStart1 = 60;&lt;br /&gt;extern int ProfitToProtect1 =30;&lt;br /&gt;extern int ProfitProtectStart2 = 120;&lt;br /&gt;extern int ProfitToProtect2 =60;&lt;br /&gt;extern int ProfitProtectStart3 = 180;&lt;br /&gt;extern int ProfitToProtect3 =90;&lt;br /&gt;extern int ProfitProtectStart4 = 240;&lt;br /&gt;extern int ProfitToProtect4 =120;&lt;br /&gt;&lt;br /&gt;Money Management tool:&lt;br /&gt;extern string MM = "Money Management";&lt;br /&gt;extern bool UseMoneyManagement=true;&lt;br /&gt;extern bool UseMicroLots = false;&lt;br /&gt;extern int MaximumRisk = 5;&lt;br /&gt;extern string FixedLot = "Fixed Lots";&lt;br /&gt;extern double FixedLots = 0.1;&lt;br /&gt;&lt;br /&gt;Magic Number: This number is used to identify singles orders from the EA, be sure that is different for each chart and for each currencies pair you trade.&lt;br /&gt;extern int MagicNumber = 852745962;&lt;br /&gt;&lt;br /&gt;Indicators settings:&lt;br /&gt;extern int FastMAPeriod = 57;&lt;br /&gt;extern int FastMAShift = 2;&lt;br /&gt;extern int FastMAMode = MODE_EMA;&lt;br /&gt;extern int FastMAApplyPrice = PRICE_CLOSE;&lt;br /&gt;extern int SlowMAPeriod = 19;&lt;br /&gt;extern int SlowMAShift = 12;&lt;br /&gt;extern int SlowMAMode = MODE_EMA;&lt;br /&gt;extern int SlowMAApplyPrice = PRICE_CLOSE;&lt;br /&gt;extern int Bar = 1;&lt;br /&gt;&lt;br /&gt;Others global variables the EA use to calculate some parameters in several loops of the automated system.The next variables can not been change after compilation.&lt;br /&gt;int      Number = 20;&lt;br /&gt;int      Kumo = 1;&lt;br /&gt;bool     signalBuy;&lt;br /&gt;bool     signalSell;&lt;br /&gt;bool     goShort;&lt;br /&gt;bool     goLong;&lt;br /&gt;int      ordersent;&lt;br /&gt;int      Arko;&lt;br /&gt;int      time_now;&lt;br /&gt;double   fastMA;&lt;br /&gt;double   slowMA;&lt;br /&gt;int      conditionalcheck = 0;&lt;br /&gt;double   LotSize;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;If you want to change the name of some variables you can do but make sure you change it every time the same variable appear in the expert advisor code.&lt;br /&gt;&lt;br /&gt;In the next posts I will comment all the loops and functions of the EA line by line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-3134622828582723820?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/3134622828582723820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=3134622828582723820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3134622828582723820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3134622828582723820'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/05/head-and-global-variables.html' title='Head and global variables'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-6494252195033726899</id><published>2008-05-12T14:26:00.000-07:00</published><updated>2008-09-01T09:04:12.432-07:00</updated><title type='text'>CyberEA-Template Overview</title><content type='html'>&lt;br&gt;&lt;br&gt;CyberEA-Template is an Expert Avsisor for Metatrader, this is, an automated trading program. Please note that I've not said system, the system must be added to the Template. As an example the cyberEA has a MA cross simple rules.&lt;br /&gt;&lt;br /&gt;CyberEA include a lot of tools, all of them works fine: I can say that because I use the exact same code for my live trading without errors, obviously with differents rules for open and close position.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Head and global variables&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;br /&gt;  Head: copyriht, owner link, etc.&lt;br /&gt;  Global variables: In this piece of the code we set all variables that we are going to use in several function of CyberEA. I prefer not inlcude here variables that are only used in one function, in this case the variable will be generated at he specific loop.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Start() Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  This function is the only one that is executed every tick that CyberEA recieve from the broker.&lt;br /&gt;Every time this function is executed all the parameters in this loop are calculated and based on the result others function can be called.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Money Management: LotRisk()&lt;/span&gt;&lt;br /&gt;In this loop CyberEA will calculate the lot size for the orders.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Check for Orders: BuscarOdernes()&lt;/span&gt;&lt;br /&gt;CyberEA use this one for find orders from the Expert Advisors and return a certain value for a variable that will be use later in other functions and loops.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Check for Signal: BuscarSenal()&lt;/span&gt;&lt;br /&gt;This is the core of the EA. Here is where you must write the indicators an rules for open and close position.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Check for Open: BuscarAbrir()&lt;/span&gt;&lt;br /&gt;When this loop is executed the EA will take action based on the result of BuscarSenal(): The EA will send orders to the broker.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Check for Close: BuscarCierre()&lt;/span&gt;&lt;br /&gt;Like BuscarAbrir() this loop will take action based on the result of BuscarSenal(), in this case for close position, not for open.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;TrailStop():&lt;/span&gt;&lt;br /&gt;I think all of you know what means trailstop  ;))&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;BreakEven():&lt;/span&gt;&lt;br /&gt;Loop used for modifiying orders and move stoploss to a certain levels.&lt;br /&gt;&lt;br /&gt;Read carefully details of each function and start to code your BuscarSenal() loop with your indicators and rules.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-6494252195033726899?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/6494252195033726899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=6494252195033726899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/6494252195033726899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/6494252195033726899'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/05/cyberea-template-overview.html' title='CyberEA-Template Overview'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-3117889917599789299</id><published>2008-05-11T13:53:00.001-07:00</published><updated>2008-05-11T14:57:21.374-07:00</updated><title type='text'>Before starting</title><content type='html'>&lt;center&gt;&lt;a href="http://www.prosignal.net/fx.php?AID=?091028"&gt;&lt;/a&gt;&lt;/center&gt;&lt;p&gt;&lt;br /&gt;What are you going to programming?&lt;br /&gt;Before you start to write the automated system you have to have a full and clear description of your system. Let take an example with a MA cross system:&lt;/p&gt;&lt;p&gt;Overview: signals for open and close position are going to be generated by a fast and low MA croos. If fast MA cross up slow MA open buy and close sell if there is some one.&lt;/p&gt;&lt;p&gt;This is easy but you are going to programming the rules so you have to take into consideration all variables:&lt;/p&gt;&lt;p&gt;- Type of MA? Simple, exponential, linear, ...&lt;/p&gt;&lt;p&gt;- Period?&lt;/p&gt;&lt;p&gt;- Apply price? The value are going to be calculated for close price of bar, open , high, low, middle, ...&lt;/p&gt;&lt;p&gt;- When the system are going to take action: a MA cross can happen in the current bar several times so maybe you want to wait to the current bar be completed.&lt;/p&gt;&lt;p&gt;- Are you going to use others indicators for confirmation?&lt;/p&gt;&lt;p&gt;- Which time frame are the system going to work?&lt;/p&gt;&lt;p&gt;All of this questions and others have to be answer before programming. Anyway you can set this variables as external variable for modify them later and try several configuration, so if this questions have no answer at the first moment they must be taken into consideration. If you download the CyberEA-Template you can see that all variables of the Fast and Slow MA are externals variables, so is easy change the configuration after compilation on the properties of the expert advisor.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-3117889917599789299?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/3117889917599789299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=3117889917599789299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3117889917599789299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/3117889917599789299'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/05/before-starting.html' title='Before starting'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-1851076483864908373</id><published>2008-05-10T17:11:00.000-07:00</published><updated>2008-05-11T13:53:21.071-07:00</updated><title type='text'>Message Board</title><content type='html'>Do you have questions or comments? Use comments of this post to make them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-1851076483864908373?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cablebot.blogspot.com/feeds/1851076483864908373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2489175859740167749&amp;postID=1851076483864908373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1851076483864908373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1851076483864908373'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2008/05/message-board.html' title='Message Board'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489175859740167749.post-1676715455204140038</id><published>2008-01-02T08:51:00.000-08:00</published><updated>2009-04-02T08:57:49.689-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Privacy Policy'/><title type='text'>Privacy</title><content type='html'>We are strongly committed to protecting your privacy while interacting with Shikle. Our goal is to provide you with a satisfying experience while allowing you to control your privacy and to give you a means to voice any questions or concerns you may have.&lt;br /&gt;&lt;br /&gt;Cablebot blog use blogger service. You should read Blogger's privacy policy at: http://www.blogger.com/privacy.&lt;br /&gt;&lt;br /&gt;Our third-party advertising partners may place cookies on your browser in combination with web beacons in their ads for the purposes of analyzing or auditing the effectiveness of the ads that they serve. A cookie is a small text file containing a string of characters that a website sends your computer. It records information necessary for certain website functions, such as remembering your preferences or settings. A cookie will not allow us or any third-party to learn any personally identifiable information that you have not otherwise disclosed. The use of cookies is an industry standard, and they are currently used on most major websites. Most browsers are initially set up to accept cookies, but you change your browser's cookie settings to refuse all cookies or to indicate when a cookie is being sent. Some features and services may not function properly if your cookies are disabled. A web beacon is a small image file that is placed on a web page and used in conjunction with cookies to accurately count the number of unique users who have visited a specific page or viewed a specific advertisement. Any image file on a Web page can act as a Web beacon.&lt;br /&gt;&lt;br /&gt;Google, as associate ads provider, uses DART cookie from doubleclick. You can get more information about this cookie following this link: http://www.doubleclick.com/privacy/faq.aspx.&lt;br /&gt;&lt;br /&gt;If you want to view ads about your interest you can edit your preferences on http://www.google.com/ads/preferences. Those preferences is based on websites you have visited recently.&lt;br /&gt;&lt;br /&gt;The users can disable the use of DART cookie (http://www.google.com/privacy_ads.html) through Google Ads. In order to completely keep DART cookies disable you can install this complement for your browser: http://www.google.com/privacy_ads.html. This plugin keeps your preferences even in case of erasing all cookies.&lt;br /&gt;&lt;br /&gt;We use Google Analytics for monitoring trafic on the website, you should read privacy policy from Google: http://www.google.com/intl/en_ALL/privacypolicy.html&lt;br /&gt;&lt;br /&gt;Please note that this Privacy Policy may change from time to time. We expect most such changes will be minor. We will post any Policy changes on this page and, if the changes are significant, we will provide a more prominent notice. Each version of this Policy will be identified at the bottom of the page by its effective date.&lt;br /&gt;&lt;br /&gt;Last update: April 02 2009&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489175859740167749-1676715455204140038?l=cablebot.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1676715455204140038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489175859740167749/posts/default/1676715455204140038'/><link rel='alternate' type='text/html' href='http://cablebot.blogspot.com/2009/04/privacy.html' title='Privacy'/><author><name>CableBot</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
