| New signals service! | |
|
|||||||
| 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 |
|
| View Poll Results: Your trading timeframe | |||
| 5 Mins |
|
0 | 0% |
| 10 Mins |
|
0 | 0% |
| 15 Mins |
|
2 | 13.33% |
| 30 Mins |
|
6 | 40.00% |
| 1 Hr |
|
2 | 13.33% |
| 4 Hrs |
|
5 | 33.33% |
| Voters: 15. You may not vote on this poll | |||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Ma Expert Modification
Hi All
I want help to modify this expert to open only one postion in each currency at the same plateform //+------------------------------------------------------------------+ //| maak.mq4 | //| Copyright © 2006, Abdurrazag Khaled | //| benkhaled684@yahoo.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, ABDURRAZAG KHALED" #property indicator_buffers 4 #property indicator_color1 DarkViolet #property indicator_color2 Blue #property indicator_color3 Red #property indicator_color4 Gray //---- variables extern double TakeProfit = 100; extern double Lots = 0.1; extern double TrailingStop = 19; int ib = 0; string mat = ""; double cv; int ct = 0; bool cd = true,Okay=false; int init() { ib = Bars - 20; if (ib < 0) ib = 0; return(0); } // Custor indicator deinitialization function int deinit() { return(0); } // Custom indicator iteration function int start() { int i,total; bool Okay=false; int counted_bars = IndicatorCounted(); string cds = ""; total=OrdersTotal(); if (counted_bars < 0) counted_bars = 0; if (counted_bars > 0) counted_bars--; if (counted_bars > ib) counted_bars = ib; if (Period() == 30) { double ma48c, ma48b1, ma48b2, dif0, dif1, dif2; for (i = ib-counted_bars; i >= 0; i--) { ma48c = iMA(NULL, PERIOD_M30, 48, 0, MODE_LWMA, PRICE_CLOSE, i); ma48b1= iMA(NULL, PERIOD_M30, 48, 0, MODE_LWMA, PRICE_CLOSE, i+1); ma48b2 = iMA(NULL, PERIOD_M30, 48, 0, MODE_LWMA, PRICE_CLOSE, i+2); dif0 = iMA(NULL, PERIOD_M30, 8, 0, MODE_LWMA, PRICE_CLOSE, i) - ma48c; dif1 = iMA(NULL, PERIOD_M30, 8, 0, MODE_LWMA, PRICE_CLOSE, i+1) - ma48b1; dif2 = iMA(NULL, PERIOD_M30, 8, 0, MODE_LWMA, PRICE_CLOSE, i+2) - ma48b2; // for bull cross if (dif0 > 0) { if (dif1 < 0) { cd = true; if (MathAbs(dif0) < MathAbs(dif1)) { ct = Time[i]; cv = ma48c; } else { ct = Time[i+1]; cv = ma48b1; } } else { if (dif1 == 0 && dif2 < 0) { cd = true; ct = Time[i+1]; cv = ma48b1; } } } // for beer cross if (dif0 < 0) { if (dif1 > 0) { cd = false; if (MathAbs(dif0) < MathAbs(dif1)) { ct = Time[i]; cv = ma48c; } } else { ct = Time[i+1]; cv = ma48b1; } } else { if (dif1 == 0 && dif2 > 0) { cd = false; ct = Time[i+1]; cv = ma48b1; } } } } if (cd) { cds = "bull"; checkorder(Okay); if(checkorder(true)==false) { OrderSend(Symbol(),OP_BUY,Lots,cv+35*Point,0,cv- 5*Point,cv+TakeProfit*Point,"",0,0,Green); } } else { cds = "bear"; checkorder(Okay); if(checkorder(true)==false) { OrderSend(Symbol(),OP_SELL,Lots,cv-30*Point,0,cv+5*Point,cv- TakeProfit*Point,"",0,0,Green); } } if (ct != 0) Comment("Last ", mat, " cross: ", TimeToStr(ct), ", ", cd, " at ", cv); else Comment("Last ", mat, " cross: ", cd, " at ", cv); TrailingPositionsBuy(TrailingStop); TrailingPositionsSell(TrailingStop); return(0); } bool checkorder(bool Okay) { for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS)) { if (OrderSymbol()==Symbol()) { return(true); } } } return(false); } void TrailingPositionsBuy(int TS) { for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol()) { if (OrderType()==OP_BUY) { if (Bid-OrderOpenPrice()>TS*Point) { if (OrderStopLoss()<Bid-TS*Point) ModifyStopLoss(Bid-TS*Point); } } } } } } void TrailingPositionsSell(int TS) { for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol()) { if (OrderType()==OP_SELL) { if (OrderOpenPrice()-Ask>TS*Point) { if (OrderStopLoss()>Ask+TS*Point || OrderStopLoss()==0) ModifyStopLoss(Ask+TS*Point); } } } } } } void ModifyStopLoss(double ldStopLoss) { bool fm; fm = OrderModify(OrderTicket(),OrderOpenPrice (),ldStopLoss,OrderTakeProfit(),0,CLR_NONE); } //+------------------------------------------------------------------+ |
|
|||
|
trending system?
I am comtemplating building a automatic trading system based on C. Youngs APE indicator. The part of the indicator I want to base it on is the "Alpha" indicator. In short the alpha indicator is very similar to the ADX or range action verification index, see stocks commodities mag april 2006. This alpha indicator is more responsive then the traditional adx etc.. It goes into a trend much quicker and more importantly it comes out of a trend quicker.
I would like to design a automatic trading system that would go long when the alpha starts to trend, this is usually around 1.0 alpha. I demo trade with vttrader so i cannot backtest like metatrader, so I am asking for any suggestions on a profitable trending entry method. I am thinking of using a basic moving average crossover when alpha trends. How ever I am not sure what type of system is ideal for trending markets? I could use linear regression indicator, cci, stoichastics, macd, basically the options are endless. I am just asking for any advice as to what type traders have found good during strong trending markets. Any suggestions would be compiled and live demo traded on vttrader on daily, 4hr, hr, 15 min timeframes on major crosses. I have only been trading for about 6mos, I have read alot of books and I just do not have enough expeience on what would be ideal with this indicator. I have also found that once this indicator starts to trend, a high probability counter trade also occurs after the major trend, so also a reversal entry/exit method would be appropiate. Please Advise, Thank You, M Rippy |
|
||||
|
SnapshotI
Hello,
I found this indicator which will enable you to make scrrenshoot of your diagram. This means that it can be attached to any chart where you want a image To put in the Folder of the indicators and the images is in the folder :Files
__________________
All long voyages always start from the first small steps ... |
|
|||
|
Coding Modification for EA needed
The following EA is based on the Parabolic Sar. It works very well but what I am struggling with is the following. The EA is based on a 30min EUR/USD chart. In a fast moving market the EA will open and close 2 or more trades on the same bar. I want it to only trade once on a 30min bar. Once a trade has been executed and closed it MUST NOT trade for the next 30minutes. Any help greatly appreciated. Many thanks
Another thing that would really improve this EA. When the first dot appears it enters almost at the end of the bar (end of 30mins). If possible I would like it to enter the trade as soon as the first dot appears above or below the bar. Best regards |
|
|||
|
anyone seen a candle or bar range indictor?
Hey all, Anyone know of a candle or bar indicator which can be set to alert if a certain range is hit during that candle or bar. Example a doji with zero pip range between open and close price or on the other extreme fifty pip range in the candle or bar, and when the bar or candle closes if the set number is hit an alert? Thanks Rip
|
|
|||
|
Order Pending
Hi,
Code would like it so that the EA places only 3 orders SELLLIMIT or BUYLIMIT of each time, keeping these orders for 3 hours. Or either necessary of a limitor of hanging orders, my system has placed orders of uninterrupted form and 3 are only necessary. Grateful ![]() |
|
||||
|
Hello
Just go to the following page : http://merlotti.com/EngHome/Computing/software.htm You'll find Docs, Example and Source Code ( modifiable )..... ![]() Good exploration..... DV |
|
|||
|
Help me please - Order Pending
Hi,
Code would like it so that the EA places only 3 orders SELLLIMIT or BUYLIMIT of each time, keeping these orders for 3 hours. Or either necessary of a limitor of hanging orders, my system has placed orders of uninterrupted form and 3 are only necessary. Grateful Total=OrdersTotal(); if(OrdersTotal()==0) {b1=0;b2=0;b3=0;s1=0;s2=0;s3=0;} if(OrdersTotal()>0) { //Print("Total Orders:",OrdersTotal()); //Print(b1," ",b2," ",b3," ",s1," ",s2," ",s3); for(cnt=0;cnt<Total;cnt++) { OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); if(OrderMagicNumber()==2) {b1=OrderTicket(); } if(OrderMagicNumber()==4) {b2=OrderTicket(); } if(OrderMagicNumber()==6) {b3=OrderTicket(); } if(OrderMagicNumber()==1) {s1=OrderTicket(); } if(OrderMagicNumber()==3) {s2=OrderTicket(); } if(OrderMagicNumber()==5) {s3=OrderTicket(); } } } //Buy 1 double expirar=(CurTime()+PERIOD_H1*120); if(b1==0) { if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_BUYLIMIT, Lots,B1, Slippage, STPBUY,BS, "Buy(#" + MagicNumber + ")", MagicNumber,expirar, DodgerBlue); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError()); { b1=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } //Buy 2 if (b2==0) { if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_BUYLIMIT, Lots,B2, Slippage, STPBUY,BS-0.0001, "Buy(#" + MagicNumber + ")", MagicNumber,expirar, Blue); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError()); { b2=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } //Buy 3 if (b3==0) { if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_BUYLIMIT, Lots,B3, Slippage, STPBUY,BS-0.0002, "Buy(#" + MagicNumber + ")", MagicNumber,expirar, Aqua); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError()); { b3=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } //Sell-1 if (s1==0) { if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_SELLLIMIT, Lots, S1, Slippage, STSELL, BS, "Sell(#" + MagicNumber + ")", MagicNumber,0, DeepPink); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError()); { s1=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } //Sell 2 if (s2==0) { if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_SELLLIMIT, Lots,S2, Slippage, STSELL, BS+0.0001, "Sell(#" + MagicNumber + ")", MagicNumber,0, DeepPink); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError()); { s2=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } //Sell 3 if (s3==0) { if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (StopLossMode) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0; if (TakeProfitMode) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_SELLLIMIT, Lots, S3, Slippage, STSELL, BS+0.0002, "Sell(#" + MagicNumber + ")", MagicNumber,0, DeepPink); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError()); { s3=Ticket; Print(Ticket);} if (EachTickMode) TickCheck = True; if (!EachTickMode) BarCount = Bars; return(0); } } } } if (!EachTickMode) BarCount = Bars; OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()==OP_BUYLIMIT) { OrderDelete(OrderTicket()); if(OrderTicket()==b1) {b1=0; return;} if(OrderTicket()==b2) {b2=0; return;} if(OrderTicket()==b3) {b3=0; return;} } OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()==OP_SELLLIMIT) { OrderDelete(OrderTicket()); if(OrderTicket()==s1) {s1=0; return;} if(OrderTicket()==s2) {s2=0; return;} if(OrderTicket()==s3) {s3=0; return;} } OrderSelect(b1,SELECT_BY_TICKET); if(OrderClosePrice()>0) {b1=0;} OrderSelect(b2,SELECT_BY_TICKET); if(OrderClosePrice()>0) {b2=0;} OrderSelect(b3,SELECT_BY_TICKET); if(OrderClosePrice()>0) {b3=0;} OrderSelect(s1,SELECT_BY_TICKET); if(OrderClosePrice()>0) {s1=0;} OrderSelect(s2,SELECT_BY_TICKET); if(OrderClosePrice()>0) {s2=0;} OrderSelect(s3,SELECT_BY_TICKET); if(OrderClosePrice()>0) {s3=0;} } Where it is my error? |
![]() |
| Bookmarks |
| Tags |
| simple verticle |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Looking for some Fresh Ideas | Emerald King | Metatrader 4 | 3 | 01-11-2007 07:30 PM |
| Mandarine: original request and ideas | hellkas | Digital Filters | 33 | 11-04-2006 01:46 PM |