i have joint two ea buy and sell , but in one function i can not solve it, perhaps ticket fucntion should be use. but i dont know who can it solve.
- can any one help me two joint these two ea .
- i did not reopen tickets if it is close on be
- to add one function in grid
amitkk:
Best //+------------------------------------------------------------------+ //| Buy and with SL and TP | //| Copyright © 2008, smjones | //| sjcoinc | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, smjones" #property link "sjcoinc2000@yahoo.com" #property show_inputs extern double Lots = 0.1; extern bool UseMoneyMgmt = false; extern double RiskPercent = 2; extern bool UseStop = true; extern bool UseTakeProfit = true; extern double StopLoss = 0; extern double TakeProfit = 100; extern string buyNote="0 in Entry field means Market Order Buy"; extern double buyEntry = 0.0000; extern string sellNote="0 in Entry field means Market Order Sell"; extern double sellEntry = 98.0000; string sellInput = " Sell Price "; string buyInput = " Buy Price "; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { double Risk = RiskPercent / 100; if (UseMoneyMgmt) Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2); int Mode = OP_BUYSTOP; if (Ask > buyEntry && buyEntry > 0) Mode = OP_BUYLIMIT; if (buyEntry == 0) {buyEntry = Ask; Mode = OP_BUY;} double SLB = buyEntry - StopLoss*Point, TPB = buyEntry + TakeProfit*Point; if (UseStop == false) SLB = 0; if (UseTakeProfit == false) TPB = 0; if(Lots > 0) OrderSend(Symbol(),Mode, Lots, buyEntry, 2,SLB , TPB, "Buy Script", 0, NULL, LimeGreen); return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { if (UseMoneyMgmt) Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2); int sellMode = OP_SELLSTOP; if (Bid < sellEntry && sellEntry > 0) Mode = OP_SELLLIMIT; if (sellEntry == 0) {sellEntry = Bid; Mode = OP_SELL;} double SLS = sellEntry+StopLoss*Point, TPS = sellEntry - TakeProfit * Point; if (UseStop == false) SLS = 0; if (UseTakeProfit == false) TPS = 0; if(Lots > 0) OrderSend(Symbol(),Mode, Lots, sellEntry, 2, SLS, TPS, "Sell Script",0, NULL, Red); return(0); } //+------------------------------------------------------------------+
Start
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