Re: Coding Help

#1201
mrtools wrote:
Tue Jan 05, 2021 7:44 am
milad1987 wrote:
Tue Dec 29, 2020 6:47 am
hello mrtools and everyone...
is there any way to fix this ERROR in my terminal MT5.... i coding one dynamic indicator for MT5 but now i have this ERROR : about dynamiczone.dll


2020.12.27 01:20:07.548 dz 'C:\Users\Milad\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Libraries\dynamicZone.dll' is not 64-bit version




2020.12.27 01:20:09.978 dz (EURUSD,M1) Cannot load 'C:\Users\Milad\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Libraries\dynamicZone.dll' [193]
Try this dll file in your libraries folder.
Mrtools thank you!


Re: Coding Help

#1202
mrtools wrote:
Tue Jan 05, 2021 8:01 am
traderduke wrote:
Tue Jan 05, 2021 5:33 am
MrTools
I can’t seem to get the maxbars to work on the XU-semafor but I did get it to work on the chaos semafor, can you help me out?
The XU eats up a lot of cpu.
Thank you again
Ray

XU-SEMAFOR-orig.mq4

Chaos Semafor - 3.4_Mod-3lv-mxb.mq4
Try.
mrtools
Thanks a lot, it works great

Ray

Re: Coding Help

#1203
Hi

I have a script from back in 2015, now it is not working and I can see some errors while compiling, but have no idea how to fix them.

if anyone would help me id be greatful.

Thanks

Code: Select all

#property  copyright "Copyright © 2011, sangmane."
#property  link      "sangmane@forexfactory.com" 
  
#import "EasyOrder.dll"
   int EasyOrder(int hwnd);

string obj;
int i, ticket;
   
int start()
{	
	int hwnd = WindowHandle(Symbol(),0);
	if(hwnd==0) {
		Alert("Error!");
		return;
	}
	int ret = EasyOrder(hwnd);
	Print("Return value: ",ret);	
	if(ret<0) {
		Alert("Dll function failed!");
		return;
	}	
	if(ret==1) ModifyOrder();
	else {
		for(i=ObjectsTotal()-1; i>=0; i--) {
			obj = ObjectName(i);
			if(StringFind(obj,"EASYORDER",0)>=0) ObjectDelete(obj);
		}	
	}
	InitLines();
	return (0);
}
//+------------------------------------------------------------------+

void InitLines()
{
	//Delete old lines
	bool delete;
	int pos;
	int ticket;
	for(i=ObjectsTotal()-1; i>=0; i--) {
		obj = ObjectName(i);
		if(StringFind(obj,"EASYORDER_MOD")>=0) {
			delete = True;
			pos = StringFind(obj,"#",1);
			if(pos<0) continue;
			ticket = StrToDouble(StringSubstr(obj,pos+1,StringLen(obj)-pos-1));
			if(OrderSelect(ticket,SELECT_BY_TICKET)) {
				if(OrderCloseTime()==0) delete = false;
			}
			if(delete) ObjectDelete(obj);
		}
	}
	double sl, tp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();			
			obj = "EASYORDER_MOD_SL_#"+ticket;
			sl = OrderStopLoss();
			tp = OrderTakeProfit();
			if(sl==0) sl = OrderOpenPrice();
			if(tp==0) tp = OrderOpenPrice();
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],sl);
			else DrawLine("SL",ticket,sl);
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],tp);
			else DrawLine("TP",ticket,tp);
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],OrderOpenPrice());
				else DrawLine("PRICE",ticket,OrderOpenPrice());				
			}
		}
	}
}

void ModifyOrder()
{
	string obj;
	int i, ticket;
	double sl, price, tp;
	double osl, otp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();
			sl = 0; price = 0; tp = 0;
			obj = "EASYORDER_MOD_SL_#"+ticket;
			osl = OrderStopLoss();			
			if(osl==0) osl = OrderOpenPrice();
			otp = OrderStopLoss();
			if(otp==0) otp = OrderOpenPrice();			
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-osl)>Point) sl = ObjectGet(obj,OBJPROP_PRICE1);
			}
			
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-otp)>Point) tp = ObjectGet(obj,OBJPROP_PRICE1);
			}
						
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	{
					if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-OrderOpenPrice())>Point) price = ObjectGet(obj,OBJPROP_PRICE1);
				}
			}
			
			if(sl+tp+price>0) {
				if(sl==0) sl = OrderStopLoss();
				if(tp==0) tp = OrderTakeProfit();
				if(price==0) price = OrderOpenPrice();
				OrderModify(ticket,price,sl,tp,0,CLR_NONE);
			}
		}
	}
}

void DrawLine(string type, int ticket, double level)
{
	string obj = "EASYORDER_MOD_"+type+"_#"+ticket;
	color clr = Red;
	if(type=="PRICE") clr = LimeGreen;
	//else if(type=="TP") clr = Blue;
	ObjectCreate(obj,OBJ_HLINE,0,Time[0],level,0,0);
	ObjectSet(obj,OBJPROP_COLOR,clr);
	ObjectSet(obj,OBJPROP_STYLE,STYLE_DASHDOT);
}
EasyOrder.mq4
(3.39 KiB) Downloaded 60 times

Re: Coding Help

#1204
Hello Mr.Tools and other coders. Happy and prosperous new year to you all and all traders in the house. Please i have this indicator that does not update its signal unless i click on indicator list, and bring it out, click ok, before the arrows can show up, i believe there could be some errors that is not allowing auto update, for the arrows to pop up at the appropriate time. Kindly help me to check the indicator and correct whatever error that is hindering the arrows to come up on chart on all time frame. Thanking you in advance for your precious time.
#Momentum onChartSignals Indicator v1.0.mq4
(6.92 KiB) Downloaded 76 times

Re: Coding Help

#1205
Maffe wrote:
Tue Jan 12, 2021 4:31 am
Hi

I have a script from back in 2015, now it is not working and I can see some errors while compiling, but have no idea how to fix them.

if anyone would help me id be greatful.

Thanks

Code: Select all

#property  copyright "Copyright © 2011, sangmane."
#property  link      "sangmane@forexfactory.com" 
  
#import "EasyOrder.dll"
   int EasyOrder(int hwnd);

string obj;
int i, ticket;
   
int start()
{	
	int hwnd = WindowHandle(Symbol(),0);
	if(hwnd==0) {
		Alert("Error!");
		return;
	}
	int ret = EasyOrder(hwnd);
	Print("Return value: ",ret);	
	if(ret<0) {
		Alert("Dll function failed!");
		return;
	}	
	if(ret==1) ModifyOrder();
	else {
		for(i=ObjectsTotal()-1; i>=0; i--) {
			obj = ObjectName(i);
			if(StringFind(obj,"EASYORDER",0)>=0) ObjectDelete(obj);
		}	
	}
	InitLines();
	return (0);
}
//+------------------------------------------------------------------+

void InitLines()
{
	//Delete old lines
	bool delete;
	int pos;
	int ticket;
	for(i=ObjectsTotal()-1; i>=0; i--) {
		obj = ObjectName(i);
		if(StringFind(obj,"EASYORDER_MOD")>=0) {
			delete = True;
			pos = StringFind(obj,"#",1);
			if(pos<0) continue;
			ticket = StrToDouble(StringSubstr(obj,pos+1,StringLen(obj)-pos-1));
			if(OrderSelect(ticket,SELECT_BY_TICKET)) {
				if(OrderCloseTime()==0) delete = false;
			}
			if(delete) ObjectDelete(obj);
		}
	}
	double sl, tp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();			
			obj = "EASYORDER_MOD_SL_#"+ticket;
			sl = OrderStopLoss();
			tp = OrderTakeProfit();
			if(sl==0) sl = OrderOpenPrice();
			if(tp==0) tp = OrderOpenPrice();
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],sl);
			else DrawLine("SL",ticket,sl);
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],tp);
			else DrawLine("TP",ticket,tp);
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],OrderOpenPrice());
				else DrawLine("PRICE",ticket,OrderOpenPrice());				
			}
		}
	}
}

void ModifyOrder()
{
	string obj;
	int i, ticket;
	double sl, price, tp;
	double osl, otp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();
			sl = 0; price = 0; tp = 0;
			obj = "EASYORDER_MOD_SL_#"+ticket;
			osl = OrderStopLoss();			
			if(osl==0) osl = OrderOpenPrice();
			otp = OrderStopLoss();
			if(otp==0) otp = OrderOpenPrice();			
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-osl)>Point) sl = ObjectGet(obj,OBJPROP_PRICE1);
			}
			
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-otp)>Point) tp = ObjectGet(obj,OBJPROP_PRICE1);
			}
						
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	{
					if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-OrderOpenPrice())>Point) price = ObjectGet(obj,OBJPROP_PRICE1);
				}
			}
			
			if(sl+tp+price>0) {
				if(sl==0) sl = OrderStopLoss();
				if(tp==0) tp = OrderTakeProfit();
				if(price==0) price = OrderOpenPrice();
				OrderModify(ticket,price,sl,tp,0,CLR_NONE);
			}
		}
	}
}

void DrawLine(string type, int ticket, double level)
{
	string obj = "EASYORDER_MOD_"+type+"_#"+ticket;
	color clr = Red;
	if(type=="PRICE") clr = LimeGreen;
	//else if(type=="TP") clr = Blue;
	ObjectCreate(obj,OBJ_HLINE,0,Time[0],level,0,0);
	ObjectSet(obj,OBJPROP_COLOR,clr);
	ObjectSet(obj,OBJPROP_STYLE,STYLE_DASHDOT);
}
Removed all the errors but not sure i did you any good.


Re: Coding Help

#1206
Modahen77 wrote:
Thu Jan 14, 2021 6:48 am
Hello Mr.Tools and other coders. Happy and prosperous new year to you all and all traders in the house. Please i have this indicator that does not update its signal unless i click on indicator list, and bring it out, click ok, before the arrows can show up, i believe there could be some errors that is not allowing auto update, for the arrows to pop up at the appropriate time. Kindly help me to check the indicator and correct whatever error that is hindering the arrows to come up on chart on all time frame. Thanking you in advance for your precious time.
Looks to me it repaints and possibly need a complete recoding to make it work correctly.

Re: Coding Help

#1207
mrtools wrote:
Thu Jan 14, 2021 2:56 pm
Maffe wrote:
Tue Jan 12, 2021 4:31 am
Hi

I have a script from back in 2015, now it is not working and I can see some errors while compiling, but have no idea how to fix them.

if anyone would help me id be greatful.

Thanks

Code: Select all

#property  copyright "Copyright © 2011, sangmane."
#property  link      "sangmane@forexfactory.com" 
  
#import "EasyOrder.dll"
   int EasyOrder(int hwnd);

string obj;
int i, ticket;
   
int start()
{	
	int hwnd = WindowHandle(Symbol(),0);
	if(hwnd==0) {
		Alert("Error!");
		return;
	}
	int ret = EasyOrder(hwnd);
	Print("Return value: ",ret);	
	if(ret<0) {
		Alert("Dll function failed!");
		return;
	}	
	if(ret==1) ModifyOrder();
	else {
		for(i=ObjectsTotal()-1; i>=0; i--) {
			obj = ObjectName(i);
			if(StringFind(obj,"EASYORDER",0)>=0) ObjectDelete(obj);
		}	
	}
	InitLines();
	return (0);
}
//+------------------------------------------------------------------+

void InitLines()
{
	//Delete old lines
	bool delete;
	int pos;
	int ticket;
	for(i=ObjectsTotal()-1; i>=0; i--) {
		obj = ObjectName(i);
		if(StringFind(obj,"EASYORDER_MOD")>=0) {
			delete = True;
			pos = StringFind(obj,"#",1);
			if(pos<0) continue;
			ticket = StrToDouble(StringSubstr(obj,pos+1,StringLen(obj)-pos-1));
			if(OrderSelect(ticket,SELECT_BY_TICKET)) {
				if(OrderCloseTime()==0) delete = false;
			}
			if(delete) ObjectDelete(obj);
		}
	}
	double sl, tp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();			
			obj = "EASYORDER_MOD_SL_#"+ticket;
			sl = OrderStopLoss();
			tp = OrderTakeProfit();
			if(sl==0) sl = OrderOpenPrice();
			if(tp==0) tp = OrderOpenPrice();
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],sl);
			else DrawLine("SL",ticket,sl);
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],tp);
			else DrawLine("TP",ticket,tp);
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	ObjectMove(obj,0,Time[0],OrderOpenPrice());
				else DrawLine("PRICE",ticket,OrderOpenPrice());				
			}
		}
	}
}

void ModifyOrder()
{
	string obj;
	int i, ticket;
	double sl, price, tp;
	double osl, otp;
	for(i=0; i<OrdersTotal(); i++) {
		OrderSelect(i,SELECT_BY_POS);
		if(OrderSymbol()==Symbol()) {
			ticket = OrderTicket();
			sl = 0; price = 0; tp = 0;
			obj = "EASYORDER_MOD_SL_#"+ticket;
			osl = OrderStopLoss();			
			if(osl==0) osl = OrderOpenPrice();
			otp = OrderStopLoss();
			if(otp==0) otp = OrderOpenPrice();			
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-osl)>Point) sl = ObjectGet(obj,OBJPROP_PRICE1);
			}
			
			obj = "EASYORDER_MOD_TP_#"+ticket;
			if(ObjectFind(obj)>=0)	{
				if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-otp)>Point) tp = ObjectGet(obj,OBJPROP_PRICE1);
			}
						
			if(OrderType()>OP_SELL) {
				obj = "EASYORDER_MOD_PRICE_#"+ticket;
				if(ObjectFind(obj)>=0)	{
					if(MathAbs(ObjectGet(obj,OBJPROP_PRICE1)-OrderOpenPrice())>Point) price = ObjectGet(obj,OBJPROP_PRICE1);
				}
			}
			
			if(sl+tp+price>0) {
				if(sl==0) sl = OrderStopLoss();
				if(tp==0) tp = OrderTakeProfit();
				if(price==0) price = OrderOpenPrice();
				OrderModify(ticket,price,sl,tp,0,CLR_NONE);
			}
		}
	}
}

void DrawLine(string type, int ticket, double level)
{
	string obj = "EASYORDER_MOD_"+type+"_#"+ticket;
	color clr = Red;
	if(type=="PRICE") clr = LimeGreen;
	//else if(type=="TP") clr = Blue;
	ObjectCreate(obj,OBJ_HLINE,0,Time[0],level,0,0);
	ObjectSet(obj,OBJPROP_COLOR,clr);
	ObjectSet(obj,OBJPROP_STYLE,STYLE_DASHDOT);
}
Removed all the errors but not sure i did you any good.
Thank you a million times :)

Re: Coding Help

#1208
Maffe wrote:
Thu Jan 14, 2021 8:42 pm
mrtools wrote:
Thu Jan 14, 2021 2:56 pm


Removed all the errors but not sure i did you any good.
Thank you a million times :)
Hi Mr.Tools

Still seems to get 6 errores, did you paste the new code?

Re: Coding Help

#1209
Maffe wrote:
Fri Jan 15, 2021 5:09 am
Maffe wrote:
Thu Jan 14, 2021 8:42 pm


Thank you a million times :)
Hi Mr.Tools

Still seems to get 6 errores, did you paste the new code?
I may have accidentally posted the old code, try this one.
Easy Order.mq4
(6.94 KiB) Downloaded 73 times

Re: Coding Help

#1210
mrtools wrote:
Fri Jan 15, 2021 12:12 pm
Maffe wrote:
Fri Jan 15, 2021 5:09 am


Hi Mr.Tools

Still seems to get 6 errores, did you paste the new code?
I may have accidentally posted the old code, try this one.
million thanks, now i have 0 errores :D


  1. Similar Topics

    1. Coding help please

      1 Replies 373 Views

      by Deez, Thu Nov 05, 2020 6:54 pm in Coding Help

      1 Replies
      373 Views
    2. Coding help

      0 Replies 492 Views

      by Mukhari325, Mon Jul 20, 2020 8:54 pm in Coding Help

      0 Replies
      492 Views

Return to “Coding Help”