I can not help because I am not a coder sorry.
But I think some coder may help I hope..
if(OrdersTotal() == 0) Ordine();
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forumif((iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_KIJUNSEN,1)>iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_TENKANSEN,1)) && Bid<iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_SENKOUSPANA,1) && Bid<iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_SENKOUSPANB,1) && (iRSI(Symbol(),PERIOD_CURRENT,14,PRICE_CLOSE,0)<=50) && (iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,0)<(iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,1)<(iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,2))>=20)) && (iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)<(iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1)<(iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,2))))){
Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. I'm not going to go scrolling (or moving my eyes) back and forth trying to read it. Don't copy and past code, write self documenting code.double kijunsen = iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_KIJUNSEN,1); double tenkansen = iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_TENKANSEN,1); double spanA = iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_SENKOUSPANA,1); double spanB = iIchimoku(Symbol(),PERIOD_CURRENT,7,22,44,MODE_SENKOUSPANB,1); double rsi = iRSI(Symbol(),PERIOD_CURRENT,14,PRICE_CLOSE,0); double main0 = iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,0) double main1 = iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,1); double main2 = iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_SMA,0,MODE_MAIN,2); double macdSig0 = iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0); double macdSig1 = iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1); double macdSig2 = iMACD(Symbol(),PERIOD_CURRENT,12,26,9,PRICE_CLOSE,MODE_SIGNAL,2); if((kijunsen>tenkansen) && Bid<spanA && Bid<spanB && (rsi<=50) && (main0<(main1<(main2)>=20)) && (macdSig0<(macdSig1<(macdSig2)))){
And then should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum- True = 1 and false = 0 so you get
if( 3 < 2 < 1 ) if( false < 1 ) if( 0 < 1 ) if( true )
if( 3 > 2 > 1 ) if( true > 1 ) if( 1 > 1 ) if( false )
ticket = OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopL*10*Point,Ask+TakeP*10*Point,"Ordine Buy",MagicNumber,0,clrMagenta);
You buy at the Ask and sell at the Bid.- Your buy order's TP/SL are triggered when the Bid reaches it. Not the Ask.
-
Your sell order's TP/SL will be triggered when the Ask reaches it. To trigger at
a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 3 - The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools -> Options {control-O} -> charts -> Show ask line.)
-
Using Points means code breaks on 4 digit brokers, exotics (e.g. USDZAR
where spread is over 500 points,) and metals. Compute what a PIP is and use it,
not points.
How to manage JPY pairs with parameters? - MQL4 and MetaTrader 4 - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum Lots=(AccountBalance()*RischioIns/100)/(MarketInfo(Symbol(),MODE_TICKVALUE)*diff*MathPow(10,MarketInfo(Symbol(),MODE_DIGITS)));
1/10Digits == _Point always. It is diff*TickValue/TickSize not TickValue/Point and definitely not TickValue*10000. Write self-documenting code.
Risk depends on your initial stop loss, lot size, and the value of the pair.- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
-
Do NOT use TickValue by itself - DeltaPerLot
and verify that MODE_TICKVALUE is returning a value in your deposit
currency, as promised by the documentation, or whether it is returning a value
in the instrument's base currency (EUR, in this case).
MODE_TICKVALUE is not reliable on non-fx instruments with many brokers. - You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out
Sergey Golubev:
I can not help because I am not a coder sorry.
But I think some coder may help I hope..

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Guys my first EA doesn't open any sell order.. only buy.. can you help me ?