Forum

Question Selecting order specific EA

Hallo, im looking for a code that allows me to search trough the accounthistory and selects the last 30 trades that a particular EA magic number 66666 has made. Can anybody help me please? Kind Regards Rene

Question Selecting order specific EA

Hallo, I want to select the last 30 orders form my EA with the magicnumber 999999 in MQL4. Currently my code is like this which doesnt account for the MagicNumber: OrderSelect (OrdersHistoryTotal()- 30 ,SELECT_BY_POS,MODE_HISTORY); double G30 = OrderProfit();

Trailing stop

Hallo, Can someone help me with a trailingstop code in MQL4? Currently im adjusting my order with evey tick that goes in the desired direction of my trade. What I am looking for is a way to keep the trailingstop in the EA without adjusting it on every tick, once the stop is hit than close the order

Get highest balance value

Hallo, Im looking for a function in MQL4 that allows trading volume to be set at 0.01 lotz if balance drops 10% Can anybody help me please? Kind Regards

Using Binnary Branch Lots Determination

Hallo, I am using A binnary tree to determine the lotsize depending on the profit of the last three orders. Is it possable that the function OrdersHistoryTotal() doenst work while backtesting ? OrderSelect (OrdersHistoryTotal()- 1 ,SELECT_BY_POS,MODE_HISTORY); double P5 =

Question EA

Hallo, Im trying to write an EA based on PSAR and MACD. if the PSAR gives a Sell Signal and the MACD is less than its signal line i want to place a Sell order. When backtesting the EA doesnt open a Sell if the trade logic includes: if (openorders== true ) if (PSAR_BAR1 < CLOSE_BAR1 && PSAR_BAR0 >

Question stoploss

Hallo I''m working on a trailingstop wich isnt sent to the broker everytime a better stoploss is possable. The problem I have is that the EA now Opens and closes orders in rappid fire. can someone help me? bool TS; if ( OrdersTotal ()> 0 ) TS= true ; double currentprice = Bid ; int total =

Evaluating Trading Strategies

Just a question, How do we evaluate trading strategies ? sinces some only work from time to time. (for example form 2000 untill 2002 and than turn losing up to 2007 and than start being profatable again?) can anybody point me in a directon of maybe sugest some literature ? Thanks

Amount of openorders Question

Hello, I'm trying to code a EA that allows to open buy and sell orders simultaneously, but only one order per type. (open only one BUY order, and open only one SELL order). Could somebody please explain me how I can do this? At the moment I am using if(OrdersTotal()<1) to block the EA form opening

Different Backtest Results

Hello, At the moment I am back testing a EA which I wrote. I haven't changed anything to the code itself but i keep getting different back test results when i change account. I am testing with Alpari Clasic 2 which gives back good results, and with Alpari Mico 2 which gives very poor results. Can