Forum

What does this standard code do?

Can someone explain to me what does this standard code-block on top of most indicators do? I looked up the documentation of these functions , but I don't understand what does it accomplish. int counted_bars = IndicatorCounted ( ) ; //---- int limit = barsBack - counted_bars ; if (

Variable Scope Inside Loop?

Hi, for ( int i = barsBack ; i > = 0 ; i - - ) { bool MACrossedUp ; int event ; MACrossedUp = true ; event = 10 ; } I would expect both these variables to initialize to their default values (false, 0) in each for loop iteration, because I declare them inside the loop. This is

Relaying Denied / Invalid BLOB Error in Metatrader

Hi, I am trying to Test sending an email from the Options>Email Dialog Box. The journal is repeatedly reporting "Relaying Denied", or "FlashFiler: Invalid BLOB" Errors, using two different private SMTP servers. The recepient emails are gmail, yahoo and hotmail accounts. I had successfully sent

Lower TF Cross on Higher TF Chart.

Hi, I want to know how do I plot a Lower Timeframe MA cross on a Higher Timeframe chart. e.g. I want to plot an arrow on H1 chart when M15 's MA5 and MA10 cross. Please let me know. Thanks, JForex

Terminate an EA.

Hi, How can I terminate an EA if certain inputs are incorrect? I do not want to put a conditional return in start() because its still running and catching the error on every tick . I need something that can just stop executing the EA if the input params are incorrect. Is this possible? Thanks

Simple Alert from Mobile MT4?

Hi, I just need a simple MACD Cross Alert from Mobile MT4 on a mobile device like a PocketPC. Is this impossible? Thanks, JForex

MTF Values question.

Hi, I put PERIOD_M1 in the Timeframe param, and attach this indicator to a M5-chart (not M1-chart). double MA20 = iMA ( NULL , PERIOD_M1 , 20 , 0 , MODE_SMA , PRICE_CLOSE ,1 ) ; What does this give me? The value of MA-20 on M5's last bar , or value of MA-20 on M1's last bar ? I am having trouble

Array Initialization Question.

Hi, If I declare an array of size 1, I can write and read values much beyond 1. How is this possible? Is it resizing everytime? Also, I noticed that I either have to initialize the array, or provide a size during declaration for it to work properly. See the code below that does none of these, and

EA code to resume trades after shut down.

Hi, Is there any sample code for an EA, that can resume managing the trades after its stopped and then comes back again? Thanks, JForex

Please review my EA.

Hi, The goal of my simple EA is to Print when the Price is very close to the Bollinger Bands . Can someone review if this is correct? My primary doubt is about using Close[0] or Close[1]. How can Close[0] return the closing price of a current bar, when current bar is not yet closed. Thanks, JForex