Codes

Count All the Pending Orders for MetaTrader 4

This Expert Advisor will count all the pending orders for the chart it has been placed on

Pausing execution of EA until certain time has passed for MetaTrader 4

This code will get the current time , wait until a certain amount of Seconds has passed and then continue processing

SLTP Currency for MetaTrader 4

This EA will use the deposit currency as Stop Loss and Take Profit for each trade, once profit or loss has been reached it will close the entire trade

Forum

objectcreate does not show in 2 instances of custom indicator

objectcreate does not show in 2 instances of custom indicator log with 2 instances after compiling 00:00:18.605 mctc EURGBP,M5: uninit reason 2 0 00:00:18.621 Custom indicator mctc EURGBP,M5: removed 0 00:00:18.633 Custom indicator mctc EURGBP,M5: loaded successfully 0 00:00:18.649 mctc EURGBP,M5

custom indicator only displays object create in 1st window

custom indicator if I place it twice on a chart it only displays the objectdraw in one of the indicators how do I get it to display objectdraw in both instances ? log file: after compiling with 2 instances of indicator running 0 00:00:18.633 Custom indicator mctc EURGBP,M5: loaded successfully 0

iCustom stops getting buffer values

Hi there Im using icustom to get the values from a indicator , but after some time it stops getting the values. here is the code Im using. any suggestions would be wecome. thanks //------------------------x----------------------- int start() { value0 = iCustom ( NULL , 0 , "Ultimate" , 0 , 0 , 0

help me code something better than this.

this works but its rubbish. during the first 1 or < 5 minutes of a new hour or bar , I want to check for a condition: string check; Hr=Hour(); Min=Minute(); check = "n"; if(Hr == 0 && Min == 0 ) {check="y";} if(Hr==1 && Min==0) {check="y";} if(Hr==2 && Min==0) {check="y";}

a noobie question - help please

Hi there Im not asking for code , just a point in the right direction: I need to define a changing variable, kinda hard to explain , so Ive sort've coded it: extern int number= 'xxx'; // user input 1/2/3 . . etc . . . . double value1 = OrdersTotal(); double value2 =OrdersTotal(); double

a little help with EA and indicator please

Hi there So I have managed to get the buffer values from my indicator into my EA using iCustom() , no problems and all is workinf well. Im struggling to pass inputs from the EA to the indicator , when the EA starts up. can someone just point me in the right direction thanks

help - how to only read back 8 bars

I only want my ea to read back 8 bars , here is my code but its not working , seems it reads all the bars ... int start_bar = Bars ; //Print (start_bar); for ( int bar = start_bar; bar >= 0 ; bar--) { //if (bar > 8) break; value = (iClose( NULL , 0 ,bar)); //Print (value); //Print("bar= ",bar);

help with break out of while statement

sometimes my trades don't always go through , so I run it in a while loop , but if I get error 134 (no enough money , it must break out the while loop , cant seem to get it right , can someone help me please

correct way to open orders ? , ordersend ...

I use this code to open orders , the OP_SELL works correctly , BUT the OP_BUY is always 2 pips below of the 'take_profit' level , why ? , something wrong ? OrderSend ( Symbol (), OP_BUY, lots ,Ask, 3 , Ask - stop_loss * Point , Bid + take_profit * Point , IDENT, MAGIC, 0 , Blue ); OrderSend ( Symbol

orderclose - bid or ask for buy or sell ?

hi guys what is the correct bid / ask usage when closing buy or sell orders: is the correct ? OrderClose(OrderTicket(),OrderLots(),Bid,slippage,CLR_NONE); ----- buy orders OrderClose(OrderTicket(),OrderLots(),Ask,slippage,CLR_NONE); ----- sell orders thanks