global warnings

Post Reply
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

global warnings

Post by traderduke »

I get these from time to time but I'm not sure how to clear them, any help would be appreciated.


////////////////////////////////////////////////////////////////////////////////////////
Line 24; double price, stop, take;

Line 165; bool SendSingleTrade(int type, string comment, double lotsize, double price, double stop, double take)

Warning line
declaration of 'price' hides global declaration at line 24 -- RK-Philipp's Pending Sell Script-L.mq4 165 71

Not sure if my layout will show correctly.

Regards Ray
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

global warnings

Post by renexxxx »

traderduke » Tue Sep 01, 2015 6:40 am wrote:I get these from time to time but I'm not sure how to clear them, any help would be appreciated.


////////////////////////////////////////////////////////////////////////////////////////
Line 24; double price, stop, take;

Line 165; bool SendSingleTrade(int type, string comment, double lotsize, double price, double stop, double take)

Warning line
declaration of 'price' hides global declaration at line 24 -- RK-Philipp's Pending Sell Script-L.mq4 165 71

Not sure if my layout will show correctly.

Regards Ray
This means that you have declared a global variable ( double price; ) somewhere at the top of your file, as well as the 'double price' parameter inside the SendSingleTrade function. The compiler is a little bit confused inside the function body, as to which 'price' variable you mean? Do you mean the global variable 'price' or the local parameter 'price'. It assumes that you mean the local parameter 'price' but it just wants to let you know that there is some confusion and that you should rename one of the two.
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

global warnings

Post by traderduke »

Renexxxx
Thanks for taking the time to answer me.
My concern was that price should be changed WHERE? The global double seems to be all over the place. So I changed line 165 to price1 along with all of its (what appears to be ) price to price1.

Well the warnings are gone and compiled , now to see if it works.

Thanks again
Ray


renexxxx » Mon Aug 31, 2015 7:52 pm wrote:
traderduke » Tue Sep 01, 2015 6:40 am wrote:I get these from time to time but I'm not sure how to clear them, any help would be appreciated.


////////////////////////////////////////////////////////////////////////////////////////
Line 24; double price, stop, take;

Line 165; bool SendSingleTrade(int type, string comment, double lotsize, double price, double stop, double take)

Warning line
declaration of 'price' hides global declaration at line 24 -- RK-Philipp's Pending Sell Script-L.mq4 165 71

Not sure if my layout will show correctly.

Regards Ray
This means that you have declared a global variable ( double price; ) somewhere at the top of your file, as well as the 'double price' parameter inside the SendSingleTrade function. The compiler is a little bit confused inside the function body, as to which 'price' variable you mean? Do you mean the global variable 'price' or the local parameter 'price'. It assumes that you mean the local parameter 'price' but it just wants to let you know that there is some confusion and that you should rename one of the two.
Post Reply

Return to “Coders Hangout”