Jump to content

Recommended Posts

Posted

extern string a07="Expert Local Time Work";

extern bool LocalCalisma=False;

extern int LocalBaslamaSaati = 00; // example 06

extern int LocalBitisSaati = 00; // example 23

int start()

{

if (LocalCalisma)

{

int h1=TimeHour(TimeLocal());

if (h1<LocalBaslamaSaati) return;

if (h1>LocalBitisSaati) return;

}

Posted

Thanks drbastem but it doesn't work :(

Here is the original .mq4 :

 

  Quote
/*

Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []

Website: http://purebeam.biz

E-mail : purebeam@gmail.com

*/

#property copyright "Copyright by Forex Brilliance"

#property link "http://www.forexbrilliance.com"

 

#import "EURUSD.dll"

void InitLibrary(int a0, double a1, double a2, double a3, double a4, int a5);

void GetCC(int a0, int a1, int a2, string a3);

int GetMAPeriod();

int GetWPRPeriod();

void SetIndicatorMA(double a0);

void SetIndicatorWPR(double a0);

bool CloseOrder(int a0);

void CalculateOrderSendParams(int a0, double a1, double a2, double a3, double a4, double a5, double a6, double a7, int a8);

int GetOrderType();

double GetOrderLotSize();

double GetOrderOpenPrice();

double GetOrderStopLoss();

double GetOrderTakeProfit();

#import

 

extern int Magic = 20100101;

extern double Lots = 1.0;

extern int StopLoss = 50;

extern int TakeProfit = 30;

extern int Slippage = 3;

extern double MaxSpread = 4.0;

extern int Enable_MM = 0;

extern double Risk_Percent = 20.0;

extern string a07="Time Setting";

extern bool LocalCalisma=False;

extern int LocalBaslamaSaati = 00;

extern int LocalBitisSaati = 00;

string gs_120 = "23thjuiwsghjei89028jkdl";

string gs_unused_128 = "Forex Brilliance";

 

 

 

void init() {

}

 

void start() {

int li_0;

int l_ticket_24;

int l_year_4 = Year();

int l_month_8 = Month();

int l_day_12 = Day();

if (Digits == 2 || Digits == 4) li_0 = 1;

if (Digits == 3 || Digits == 5) li_0 = 10;

InitLibrary(MarketInfo(Symbol(), MODE_STOPLEVEL), MarketInfo(Symbol(), MODE_MINLOT), MarketInfo(Symbol(), MODE_MAXLOT), StopLoss, TakeProfit, li_0);

GetCC(l_year_4, l_month_8, l_day_12, gs_120);

if (Ask - Bid > (MaxSpread + 0.2) * Point * li_0) {

Comment("Spread exceeds max allowed value : " + MaxSpread);

return;

}

HideTestIndicators(TRUE);

SetIndicatorMA(iMA(NULL, PERIOD_M15, GetMAPeriod(), 0, MODE_SMMA, PRICE_CLOSE, 1));

SetIndicatorWPR(iWPR(NULL, PERIOD_M15, GetWPRPeriod(), 1));

HideTestIndicators(FALSE);

Slippage *= li_0;

for (int l_pos_16 = OrdersTotal() - 1; l_pos_16 >= 0; l_pos_16--) {

if (OrderSelect(l_pos_16, SELECT_BY_POS, MODE_TRADES)) {

if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {

if (OrderMagicNumber() == Magic) {

if (OrderType() == OP_BUY) {

if (CloseOrder(OrderType())) {

RefreshRates();

OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), Slippage, Violet);

}

}

if (OrderType() == OP_SELL) {

if (CloseOrder(OrderType())) {

RefreshRates();

OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), Slippage, Violet);

}

}

}

}

}

}

CalculateOrderSendParams(Enable_MM, Lots, Risk_Percent, AccountFreeMargin(), iClose(NULL, PERIOD_M15, 1), Point * li_0, Ask, Bid, Digits);

RefreshRates();

int l_cmd_20 = GetOrderType();

if (l_cmd_20 >= OP_BUY) {

l_ticket_24 = OrderSend(Symbol(), l_cmd_20, GetOrderLotSize(), GetOrderOpenPrice(), Slippage, GetOrderStopLoss(), GetOrderTakeProfit(), "fb", Magic);

Sleep(5000);

if (l_ticket_24 > 0) {

if (OrderSelect(l_ticket_24, SELECT_BY_TICKET, MODE_TRADES)) Print("order " + l_ticket_24 + " opened at : ", OrderOpenPrice());

} else Print("error opening order " + l_ticket_24 + ", the error message is :", GetLastError());

}

}

 

Can you help me to implement please ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...