fx4_ever Posted November 7, 2012 Report Share Posted November 7, 2012 Hi: Anyone know of any EA that enters on Pivot Level Resistance and Support Level? Preferrably R3, S3, but if not, I can modify the formular. Just looking for Pivot S/R entry EA. Thanks, Quote Link to comment Share on other sites More sharing options...
iwjw Posted November 8, 2012 Report Share Posted November 8, 2012 Simply trading pivots doesn't work...no matter which level You have to watch what's happening around the levels and that can't be automated. If I find the EA I used for testing I'll post it here. Reaching R3/S3 doesn't have a higher probability for a reversal than the other level The problem with these extreme levels is that you don't get enough trades in that area to compensate for the high ATR Days where price doesn't care about R3/S3 and just blows through Quote Link to comment Share on other sites More sharing options...
fx4_ever Posted November 8, 2012 Author Report Share Posted November 8, 2012 I am not looking to use straight R3/S3 entry process. I need to see the EA that based on Pivot Support and Resistant level, so that I can modify what I have. Thanks for the comment though... appreciate if you can find anything and share it with me here. Quote Link to comment Share on other sites More sharing options...
tongtoro Posted November 8, 2012 Report Share Posted November 8, 2012 you can use this tempalte //+------------------------------------------------------------------+ //| TangoPivotEA.mq4 | //+------------------------------------------------------------------+ #property copyright "[email protected]" #property link "" extern int Delta1 = 5; // minimalna daljina close prehodnog dana od cppa novog dana extern int Delta2 = 100; // maximalna -"- extern double Lot = 0.01; int MagicniBroj=1; double VrednostPipa; double AccountEquityPocetni; double AccountBalancePocetni; int decimala; int BE=30; int init() { VrednostPipa = VrednostPipa(Symbol()); decimala=MarketInfo(Symbol(),MODE_DIGITS); AccountEquityPocetni = AccountEquity(); return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { if (iVolume(NULL,PERIOD_M15,0)==1) { BEnaPipa(); } if (iVolume(NULL,PERIOD_D1,0)==1) { double DHigh, DLow, DClose; double R3,R2,R1,CPP,S1,S2,S3,S4,S5,R4,R5,mr1,ms1; double TPBuy1,TPBuy2,TPBuy3,TPSell1,TPSell2,TPSell3; double SLBuy,SLSell; int ticket; DHigh = iHigh(NULL,PERIOD_D1,1); DLow = iLow(NULL,PERIOD_D1,1); DClose = iClose(NULL,PERIOD_D1,1); CPP = NormalizeDouble(((DHigh + DLow + DClose)/3),decimala); if (DayOfWeek()==0 && TimeDayOfWeek(Close[1])==5) { // ako smo u nedelji a prethodna sveca je petak double H = iHigh(NULL,PERIOD_D1,1); double L = iLow(NULL,PERIOD_D1,1); double CLOSE = iClose(NULL,PERIOD_D1,1); } else if (DayOfWeek()==1 && TimeDayOfWeek(Close[1])==0 && TimeDayOfWeek(Close[2])==5) { // ako smo u ponedeljku a prethodna sveca je nedelja H = iHigh(NULL,PERIOD_D1,2); L = iLow(NULL,PERIOD_D1,2); CLOSE = iClose(NULL,PERIOD_D1,2); } else { // ostalih dana uzmi prethodni dan H = iHigh(NULL,PERIOD_D1,1); L = iLow(NULL,PERIOD_D1,1); CLOSE = iClose(NULL,PERIOD_D1,1); } // STANDARD PIVOTS R1 = (2*CPP)-DLow; S1 = (2*CPP)-DHigh; R2 = CPP+(R1-S1); S2 = CPP-(R1-S1); R3 = (2.0*CPP) + (DHigh-(2.0*DLow)); S3 = (2.0*CPP) - ((2.0*DHigh)-DLow); mr1 = (R1+CPP)/2; ms1 = (S1+CPP)/2; TPBuy1=NormalizeDouble(R1,decimala); TPBuy2=NormalizeDouble(R2,decimala); TPBuy3=NormalizeDouble(R3,decimala); TPSell1=NormalizeDouble(S1,decimala); TPSell2=NormalizeDouble(S2,decimala); TPSell3=NormalizeDouble(S3,decimala); SLBuy = NormalizeDouble(S1-0*VrednostPipa,decimala); SLSell = NormalizeDouble(R1+0*VrednostPipa,decimala); BE = MathRound((R2-CPP)/VrednostPipa); int Isticanje = TimeCurrent()+16*3600; // ima smisla trejd do 16h popodne // na pocetku novog dana redjamo pendinge ako imamo zeljenu razliku izmedju Close i novog CPP, pending stavljamo na cpp racunamo vratice se do njega if(CPP-DClose>Delta1*VrednostPipa && CPP-DClose<Delta2*VrednostPipa){ ticket = OrderSend(Symbol(),OP_SELLLIMIT, Lot, CPP, 3, SLSell, TPSell1, "",MagicniBroj,Isticanje,Red); if (AccountBalance()>AccountBalancePocetni) { ticket = OrderSend(Symbol(),OP_SELLLIMIT, Lot, CPP, 3, SLSell, TPSell2, "",MagicniBroj,Isticanje,Red); if (AccountBalance()>2*AccountBalancePocetni) { ticket = OrderSend(Symbol(),OP_SELLLIMIT, Lot, CPP, 3, SLSell, TPSell3, "",MagicniBroj,Isticanje,Red); } } } if(DClose-CPP>Delta1*VrednostPipa && DClose-CPP<Delta2*VrednostPipa){ ticket = OrderSend(Symbol(),OP_BUYLIMIT, Lot, CPP, 3, SLBuy, TPBuy1, "",MagicniBroj,Isticanje,Green); if (AccountBalance()>AccountBalancePocetni) { ticket = OrderSend(Symbol(),OP_BUYLIMIT, Lot, CPP, 3, SLBuy, TPBuy2, "",MagicniBroj,Isticanje,Green); if (AccountBalance()>2*AccountBalancePocetni) { ticket = OrderSend(Symbol(),OP_BUYLIMIT, Lot, CPP, 3, SLBuy, TPBuy3, "",MagicniBroj,Isticanje,Green); } } } } } //+------------------------------------------------------------------+ double VrednostPipa(string Par) { int decimala = MarketInfo(Par,MODE_DIGITS); if (decimala==2 || decimala==3) double vrednostpipa = 0.01; if (decimala==4 || decimala==5) vrednostpipa = 0.0001; return (vrednostpipa); } void BEnaPipa() { if (BE>0) { // ako imamo BR profita, stavljamo na be for (int i = OrdersTotal() - 1; i >= 0; i--) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicniBroj) { if (OrderType() == OP_SELL) { //Print(OrderTicket()," ",OrderProfit()/OrderLots()/10 ," ",BE," ",OrderLots()); // ako je profit veci od BE i ako je sl iznad open price, stavljamo sl na op if (OrderProfit()/OrderLots()/10 >= BE && OrderStopLoss() > OrderOpenPrice()) { OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Red); } } if (OrderType() == OP_BUY) { // ako je profit veci od BE i ako je sl ispod open price, stavljamo sl na op if (OrderProfit()/OrderLots()/10 >= BE && OrderStopLoss() < OrderOpenPrice()) { OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Green); } } } } } } fx4_ever 1 Quote Link to comment Share on other sites More sharing options...
tongtoro Posted November 8, 2012 Report Share Posted November 8, 2012 or //+------------------------------------------------------------------+ //| Daily Pivot Point Trader.mq4 | //| Copyright © 2011, Alan R Phillips | //| http://www.forexfactory.com/showthread.php?t=330992 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Alan R Phillips" #property link "" extern bool EAOn = false; extern int TimeZone = 0; //currently doesn't do anything extern double LotSize = 0.1; extern int TakeProfitTarget = 0; // 3,2,1 are R3/S3,R2/S2,R1/S1. 0 is no TP //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { double DHigh, DLow, DClose; double R3,R2,R1,Pivot,S1,S2,S3; string EASymbol; double TPTargetBuy = 0.0; double TPTargetSell = 0.0; int ticket; DHigh = NormalizeDouble(iHigh(NULL,PERIOD_D1,1),4); DLow = NormalizeDouble(iLow(NULL,PERIOD_D1,1),4); DClose = NormalizeDouble(iClose(NULL,PERIOD_D1,1),4); Pivot = NormalizeDouble(((DHigh + DLow + DClose)/3),4); R1 = (2*Pivot)-DLow; S1 = (2*Pivot)-DHigh; R2 = Pivot+(R1-S1); S2 = Pivot-(R1-S1); R3 = ( 2.0 * Pivot) + ( DHigh - ( 2.0 * DLow ) ); S3 = ( 2.0 * Pivot) - ( ( 2.0 * DHigh ) - DLow ); EASymbol = Symbol(); if(TakeProfitTarget == 0) { TPTargetBuy = 0.0; TPTargetSell = 0.0; } if(TakeProfitTarget == 1) { TPTargetBuy = R1; TPTargetSell = S1; } if(TakeProfitTarget == 2) { TPTargetBuy = R2; TPTargetSell = S2; } if(TakeProfitTarget == 3) { TPTargetBuy = R3; TPTargetSell = S3; } if(EAOn == True) { if( DClose < Pivot) { ticket = OrderSend(EASymbol,3, LotSize, Pivot, 0, R1, TPTargetSell, "Opened by DPP Trader",0,0,Blue); Print(ticket); } if(DClose > Pivot) { ticket = OrderSend(EASymbol,2, LotSize, Pivot, 0, S1, TPTargetBuy, "Opened by DPP Trader",0,0,Blue); Print(ticket); } } else { Print("DPP Trader is off."); } return(0); } fx4_ever 1 Quote Link to comment Share on other sites More sharing options...
fx4_ever Posted November 8, 2012 Author Report Share Posted November 8, 2012 tongtoro, awesome! thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.