stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

global warnings
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4410
Page 1 of 1
Author:  traderduke [ Mon Aug 31, 2015 8:40 pm ]
Post subject:  global warnings

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
Author:  renexxxx [ Tue Sep 01, 2015 12:52 am ]
Post subject:  global warnings

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.
Author:  traderduke [ Wed Sep 02, 2015 12:00 am ]
Post subject:  global warnings

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.
All times are UTC Page 1 of 1