|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
What have I done?
I need help coding in MT4
I have some code below: StopLoss=EMAtrend-iClose(NULL,0,1); TakeProfit=StopLoss If(EMAshort>EMAlong && EMAshort_prev<EMAlong_prev) { OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask+StopLoss* Point,Bid+TakeProfit*Point,"Buy at close price",10000,0,Green); } If(EMAshort<EMAlong && EMAshort_prev>EMAlong_prev) { OrderSend(Symbol(),OP_SELL,Lots,Bid,0,StopLoss,Bid +TakeProfit*Point,"Sell at close price",11000,0,Red); } The idea were: 1. Open order at close price when criteria met; 2. I want to make the EMAtrend to be the stoploss level; 3. The distance between EMAtrend to Close price bar will be the distance for takeprofit from opened price I try the code above but nothing happen and there is an error 130. Please help me. |
|
|||
|
Need help with code
Hi all
I am trying to get an ea to compile, but it comes up with the following error: Code:
'TradeSymbol' - expression on global scope not allowed I:\Program Files\MetaTrader - Alpari\experts\TTL.mq4 (65, 34) Code:
string TradeSymbol; TradeSymbol=Symbol(); Code:
if(TotalTradesThisSymbol(TradeSymbol)==0) { int BS=0,SS=0,BL=0,SL=0; }
if(TotalTradesThisSymbol(TradeSymbol)>0) {
for(cnt=0;cnt<total;cnt++) {
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()== Symbol) {
if(OrderMagicNumber()==11) { BS=OrderTicket(); }
if(OrderMagicNumber()==22) { SS=OrderTicket(); }
if(OrderMagicNumber()==33) { BL=OrderTicket(); }
if(OrderMagicNumber()==44) { SL=OrderTicket(); }
}//end if(OrderSymbol
}//end for
}//end if */
I'm no good at coding , only copying and pasteing. Thanks in advance Basza
__________________
This is what might be needed to help fund your Forex Habit. Profitmatic |
|
|||
|
Quote:
PHP Code:
|
|
|||
|
help in programming
Hi i was trying to program an ea, and i followed your course (very intresting!)
I know quite well how to program in java and some c++ I was trying to program an ea with brain trend indicators the idea behind is when brainTrend2stop and braintrend1stop DOTs are present buy (and viceversa) but if i call the icustom function like this BuyValueCurrent = iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1) ; i get only the value of the indicator in the present bar is there a way to make it boolean? i'd like to write a function like buy=true BuyCondition = (IndicatorName1=true && IndicatorName2=true); can someone help please please please??? |
|
||||
|
Control if an Entry Order is Executed...
i have an EA wich open and mange the position, but sometimes give the indikator the same signal multiple and the EA open everytime this signal comes out an new position - but i dont want a second or third and so on and on position, i will only the first one - is it possible that the EA checks the open position by the basis of the magic number and pair to avoid such multiple entrys ?
__________________
....::::Sten's FX Trading Journal::::.... |
|
|||
|
Quote:
PHP Code:
|
|
|||
|
anyway it doesn't work and i don't understand and figure out why..
here are my variables PHP Code:
PHP Code:
PHP Code:
|
|
|||
|
Quote:
Quote:
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |