Forum

How to check for closed trades?

Hi fellow coders, I am trying to figure out how to stop my EA from trading if there was a trade in lets say last 5 bars. It should be relatively simple but I cant get it done. I came up with this code, where LastTradeBar is extern int and I set it to ie. 5. bool LastTrade=False; for (int i1 = 0; i1

Did I make a trade on the current bar?

Hello folks, Could you please give me a hint how to check if there is /was a transaction on the current bar? I think I need to modify this: for (int i = 0; i < Total; i ++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) { IsTrade = True; but

How to copy an array from an indicator to an EA?

Hi folks, I am trying to figure out how to copy an array from an indicator to an EA. I am using global variables in order to do that, but that obviously has its flaws ( you cannot use tester, problems when applying to multiple instruments, etc.). I know how to use iCustom in order to copy, or map or

I cannot get this simple code to work ! PLEASE HELP...

Hi people, I am struggling with this: int mlevel1upper; double rangeup[13]; for(int vx=0;vx<13;vx++) { rangeup[vx]=Zone1Upper-m_line[vx]; mlevel1upper=ArrayMinimum(rangeup,WHOLE_ARRAY,0); //double MaxRange=(High[Max]-Low[Max])/Point; } Why do I need this? Because ArrayBsearch doesn't work as

Arraybsearch problem

Hi Guys, I am creating this thread out of pure frustration. I searched metaquotes website and googled the internet ... BUT ... I cannot find an answer. What I am trying to accomplish is this i have a sorted array ( ascending,meaning that the 0 index has the smallest value) like this: double

How to store historic indicator values in an EA

Hey guys, Yesterday I got stuck with my EA. It uses an indicator but what happens is that it obviously changes all the time. However, when in trade i need the ea to use values that were calculated when the trade was opened in order to set exit strategy conditions. So i created this: double

Can anyone help me with mapping an indicator into the EA?

Hi Everyone! I have been struggling with this problem for a while. I used mql4 references and Googled so hard that actually some keypad came out of my keyboard. So what am I trying to achieve? I have this indicator SDX8 and EA from a template. SDX8 indicator draws lower and upper zones (max and lows