Find Jobs
Hire Freelancers

Convert Mql to C# for use in cTrader or cAlgo.

$30-250 USD

En curso
Publicado hace casi 8 años

$30-250 USD

Pagado a la entrega
string lockacc = ""; string expire_date = "2017.12.31 17:35"; #property copyright "Copyright 2016, [login to view URL]" #property link "[login to view URL]" #property version "1.00" #property strict #include <[login to view URL]> #define MAGICMA 20150309 //--- Inputs input double Lots = 0.01; extern int TP = 150; extern int SL = 100; input ENUM_TIMEFRAMES TF1 = PERIOD_H1; input ENUM_TIMEFRAMES TF2 = PERIOD_H4; input ENUM_TIMEFRAMES TF3 = PERIOD_D1; input bool Trailing_Stop = false; input int Trailing_Stop_Pips = 100; input int Magic_Number = 001; int BarsCount = 0; bool save = true; int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } int OpenTradesForMNandPairType(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if (OrderSymbol()== sOrderSymbol) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } int TotalTradesForMNandPairType(string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if (OrderSymbol()== sOrderSymbol) { retval++; } // sOrderSymbol } // for loop return(retval); } int CloseTradesForMNandPairType(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersHistoryTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_HISTORY); // check for opened position, symbol & MagicNumber if (OrderSymbol()== sOrderSymbol) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } int CloseAll(double iMN) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); int type = OrderType(); if(type == OP_BUY){ Print(OrderMagicNumber()); if (OrderMagicNumber()==iMN) { OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), 3); } } else{} } // for loop return(0); } int CloseTrade(double iMN) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt = itotal - 1; icnt >= 0 ; icnt--) //for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); int type = OrderType(); if(type == OP_BUY){ //Print(OrderMagicNumber()); if (OrderMagicNumber()==iMN) { OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), 3); } } else{} } // for loop return(0); } int CloseTrade1(double iMN) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt = itotal - 1; icnt >= 0 ; icnt--) //for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); int type = OrderType(); if(type == OP_SELL){ if (OrderMagicNumber()==iMN) { OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), 3); } } else{} } // for loop return(0); } int CloseTrade2(double iMN) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt = itotal - 1; icnt >= 0 ; icnt--) //for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); int type = OrderType(); if(type == OP_BUY){ //Print(OrderMagicNumber()); if (OrderMagicNumber()==iMN) { if(NormalizeDouble(OrderLots()/2,2)>MarketInfo(0,MODE_MINLOT)){ OrderClose( OrderTicket(), NormalizeDouble(OrderLots()/2,2), OrderClosePrice(), 3); } else { OrderClose( OrderTicket(), MarketInfo(0,MODE_MINLOT), OrderClosePrice(), 3); } } } else{} } // for loop return(0); } int CloseTrade3(double iMN) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt = itotal - 1; icnt >= 0 ; icnt--) //for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); int type = OrderType(); if(type == OP_SELL){ if (OrderMagicNumber()==iMN) { if(NormalizeDouble(OrderLots()/2,2)>MarketInfo(0,MODE_MINLOT)){ OrderClose( OrderTicket(), NormalizeDouble(OrderLots()/2,2), OrderClosePrice(), 3); } else { OrderClose( OrderTicket(), MarketInfo(0,MODE_MINLOT), OrderClosePrice(), 3); } } } else{} } // for loop return(0); } int TotalBuy(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if( (OrderType()==OP_BUY) ) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } int TotalSell(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if( (OrderType()==OP_SELL) ) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } int TotalBuyStop(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if( (OrderType()==OP_BUYSTOP) ) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } int TotalSellStop(double iMN, string sOrderSymbol) { int icnt, itotal, retval; retval=0; itotal=OrdersTotal(); for(icnt=0;icnt<itotal;icnt++) // for loop { OrderSelect(icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if( (OrderType()==OP_SELLSTOP) ) { if (OrderMagicNumber()==iMN) { retval++; } } // sOrderSymbol } // for loop return(retval); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int count = 0; int start() { if(lockacc != "") { if((lockacc != AccountNumber())) { return(0); } else{} } else{} if(TimeCurrent() > StrToTime(expire_date)) { return(0); } else{} double max; double min ; double lot = Lots; int spread = MarketInfo(Symbol(),MODE_SPREAD); double profit = Ask+Point*(TP); double stoploss = Ask-Point*(SL); double sprofit = Bid-Point*(TP); double sstoploss = Bid+Point*(SL); for(int i = (OrdersHistoryTotal()-1); i >= 0; i --) { OrderSelect(i, SELECT_BY_POS, MODE_HISTORY); if((OrderMagicNumber()==Magic_Number)) { if((OrderProfit() < 0)&&(count < 5)) { lot = OrderLots()*2; } else{count = 0;} break; } else{} } int bs = 0; int zz = 0; int l3 = 0; int ticket; int total,total1; ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0); ObjectSetText("ObjName","Pornsak EA",15, "Verdana", Blue); ObjectSet("ObjName", OBJPROP_CORNER, 0); ObjectSet("ObjName", OBJPROP_XDISTANCE, 20); ObjectSet("ObjName", OBJPROP_YDISTANCE, 20); //Print(MBFX10 + "//" + MBFX11 + "//"); double bal = AccountBalance(); double bal2 = AccountEquity(); double bal3 = AccountMargin(); //total=OpenTradesForMNandPairType(Magic_Number, Symbol()); total=OpenTradesForMNandPairType(Magic_Number, Symbol()); //total1=OpenTradesForMNandPairType(1, Symbol()); //--- if((total < 1)) { if ((Bars > BarsCount)) { Sleep(30000); double MBFX10 = iCustom(NULL, TF1, "Pornsak Indicator",1,1); double MBFX11 = iCustom(NULL, TF1, "Pornsak Indicator",2,1); double MBFX20 = iCustom(NULL, TF2, "Pornsak Indicator",1,1); double MBFX21 = iCustom(NULL, TF2, "Pornsak Indicator",2,1); double MBFX30 = iCustom(NULL, TF3, "Pornsak Indicator",1,1); double MBFX31 = iCustom(NULL, TF3, "Pornsak Indicator",2,1); if((MBFX10 != 2147483647)&&(MBFX20 != 2147483647)&&(MBFX30 != 2147483647)) { OrderSend(Symbol(),OP_BUY,lot,Ask,3,stoploss,profit,"firstea",Magic_Number,0,Green); BarsCount = Bars; count++; } else if((MBFX11 != 2147483647)&&(MBFX21 != 2147483647)&&(MBFX31 != 2147483647)) { OrderSend(Symbol(),OP_SELL,lot,Bid,3,sstoploss,sprofit,"firstea",Magic_Number,0,Red); BarsCount = Bars; count++; } else{} } else{} } else { double MBFX10 = iCustom(NULL, TF1, "Pornsak Indicator",1,1); double MBFX11 = iCustom(NULL, TF1, "Pornsak Indicator",2,1); double MBFX20 = iCustom(NULL, TF2, "Pornsak Indicator",1,1); double MBFX21 = iCustom(NULL, TF2, "Pornsak Indicator",2,1); double MBFX30 = iCustom(NULL, TF3, "Pornsak Indicator",1,1); double MBFX31 = iCustom(NULL, TF3, "Pornsak Indicator",2,1); //Print(MBFX10 + "//" + MBFX11 + "//"); if((MBFX10 != 2147483647)||(MBFX20 != 2147483647)||(MBFX30 != 2147483647)) { //CloseTrade1(Magic_Number); } else{} if((MBFX11 != 2147483647)||(MBFX21 != 2147483647)||(MBFX31 != 2147483647)) { //CloseTrade(Magic_Number); } else{} for(int i = (OrdersTotal()-1); i >= 0; i --) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(((MathAbs(OrderOpenPrice() - (Bid+Ask)/2)/Point) >= Trailing_Stop_Pips)&&(Trailing_Stop)&&(OrderMagicNumber()==Magic_Number)){ if( (OrderType()==OP_BUY)&&(OrderStopLoss()<(Ask-Point*(Trailing_Stop_Pips)))) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask-Point*(Trailing_Stop_Pips),0,0); } else if( (OrderType()==OP_SELL)&&(OrderStopLoss()>(Bid+Point*(Trailing_Stop_Pips))) ) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid+Point*(Trailing_Stop_Pips),0,0); } } else { } } } //---- return(0); } //+------------------------------------------------------------------+
ID del proyecto: 10915569

Información sobre el proyecto

9 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
9 freelancers están ofertando un promedio de $185 USD por este trabajo
Avatar del usuario
C# is my main skill! I found your job post and I'm very interested in your project. As a certified desktop application developer with 10-years experience developing C#, I think I have the right skills you're looking for. I'm free now and have availability beginning now. Let's build success!!! Thanks.
$155 USD en 3 días
5,0 (36 comentarios)
5,9
5,9
Avatar del usuario
I am 9+ Years of Experienced Software Developer. ASP .Net , C# , VB .Net , MVC,Visual Basic, Excel VBA , MS SQL Server , MYSQL , Oracle , MS Access, Crystal Report, Telerik , Bootstrap , HTML 5 , CSS , Java Script are my working domain. I am confident to complete the project.
$250 USD en 3 días
4,7 (21 comentarios)
5,4
5,4
Avatar del usuario
Hi, I can translate this to C# for you. Any bug fixes that's present on the original code can be discussed. I'll provide a class for you to consume wherever you want.
$200 USD en 1 día
5,0 (1 comentario)
2,2
2,2
Avatar del usuario
Hi I am looking forward to work with your proposal. I am having around 6 years of experience in the Software Development. Currently I am working with world class leading MNC. I would like to discuss in detail if you find my proposal is suitable for your project.
$155 USD en 3 días
5,0 (1 comentario)
0,6
0,6
Avatar del usuario
Hello, Thanks for submitting your project.I am experienced with ctrader/calgo. Be assured that with me, delivery is guaranteed. Skype (calgofx) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de THAILAND
บุรีรรัมย์, Thailand
0,0
0
Forma de pago verificada
Miembro desde jul 2, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.