Forum

Global variable warning

I am getting the warning "declaration of 'SLPrice' hides global variable". (When I click on the error it takes me to where I've added ***). Pretty sure this warning leads to another one as I input my stop loss as "stopLossPrice(SLPrice)". The subsequent warning is as follows: "implicit conversion

Array

When I input RSI60PO, RSI60P1, RSI60P2, RSI60P3 in my script, the correct value appears. However, when I input RSI60[0] in the script, the value returned is 0, instead of the value of RSI60P0. This happens with all four values and I'm not sure why. Thanks for the help in advance double RSI60P0 =

Repeat Trades

How can I ensure the same trade (using the same magic number) cannot be placed again until the existing one is closed

Warning

I have this code which ensures price is always rounded to the correct number of decimal points. It works fine but I keep getting the warning "implicit conversion from string to number ". Is there anyway of performing the same function without getting this warning. If not, what could happen as a

Magic Number

I'd like to create a function which returns the number of trades using a specific magic number . Does anyone have ideas as to how that could be achieved? Not necessarily asking for specific code but possibly ways I could use existing mql4 functions. Thanks in advance

Multi Symbol, Magic Number & repeat orders

I have this function which checks whether there are open trades using a certain magic number. The problem is I intend on using this EA for multiple currencies at once. Each order using a certain magic number depends on certain criteria being met but other criteria could appear in other currency

Incorrect return values

Whenever I test the rsi values using this code, the value returned is always 0. I don't understand why. I appreciate your help in advance double RSI15 = iRSI ( NULL , PERIOD_M15 , 0 , PRICE_CLOSE , 0 ); double RSI60 = iRSI ( NULL , PERIOD_H1 , 0 , PRICE_CLOSE , 0 ); double RSI240 = iRSI ( NULL

Rounding Error

I am attempting to round my StopLossPrice to the nearest tick but there is an error which I don't know how to solve. Most of the time the value returned is correct although sometimes StopLossPrice returns a value similar to x.xxx0000000001. I have tried replacing MODE_TICKVALUE with _Digits

Why does the NormalizeDouble function only work sometimes?

The StopLossPrice always returns the correct value. However, the price it returns is not always the correct amount of decimal places. Does anyone know why and how it can be corrected? Thank you double StopLossPrice() { // Buying Opportunities if (BullishCandlestick() == true &&

Optimal Lot Size

For the most part, my OptimalLotSize function is working well but on certain currency pairs lie CADJPY it does not work. Can't seem to figure out why double GetPipValue() { if ( _Digits >= 4 ) { return 0.0001 ; } else { return 0.01 ; } }