Are there volunteers or freelance that are available to convert MQL4 codes to C#?
QUANTCONNECT COMMUNITY
Are there volunteers or freelance that are available to convert MQL4 codes to C#?
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Uncle bob
using System; using CodeBase; using Interfaces; using System.Drawing; using System.ComponentModel; namespace UserCode { [Serializable] public class Moving Average : EABase { #region Properties #endregion //+------------------------------------------------------------------+ //| expert default constructor. DO NOT REMOVE | //+------------------------------------------------------------------+ public Moving Average() { copyright = "2005-2014, MetaQuotes Software Corp."; link = "http://www.mql4.com"; description = "Moving Average sample expert advisor"; } private const double MAGICMA = 20131111 ; input double Lots =0.1; input double MaximumRisk =0.02; input double DecreaseFactor=3; input int MovingPeriod =12; input int MovingShift =6; int CalculateCurrentOrders(string symbol) { int buys=0,sells=0; int i; for(i=0;i0) return(buys);
else return(-sells);
}
double LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal();
int losses=0;
lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1);
if(DecreaseFactor>0)
{
int i;
for(i=orders-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)
{
Print("Error in history!");
break;
}
if(OrderSymbol()!=Symbol() | OrderType()>OP_SELL)
continue;
if(OrderProfit()>0) break;
if(OrderProfit()<0) losses++;
}
if(losses>1)
lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
}
if(lot<0.1) lot=0.1;
return(lot);
}
void CheckForOpen()
{
double ma;
int res;
if(Volume[0]>1) return;
ma=iMA(null,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,0);
if(Open[1]>ma & Close[1]ma)
{
res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,0,0,"",MAGICMA,0,Blue);
return;
}
}
void CheckForClose()
{
double ma;
if(Volume[0]>1) return;
ma=iMA(null,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,0);
int i;
for(i=0;ima & Close[1]ma)
{
if(!OrderClose(OrderTicket(),OrderLots(),Ask,3,White))
Print("OrderClose error ",GetLastError());
}
break;
}
}
}
void OnTick()
{
if(Bars<100 | IsTradeAllowed()==false)
return;
if(CalculateCurrentOrders(Symbol())==0) CheckForOpen();
else CheckForClose();
}
}
}
Tadas Talaikis
Uncle bob
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!