|
|||||||
| 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 (8) | Thread Tools | Display Modes |
|
||||
|
Thank you WNW
__________________
|
|
|||
|
I found some interesting indicator.
Author is KimIV. It is his website. i-SignalOfTrade indicator. Download from here (WinRar archive). This indicator will signal to you about any trading events on your account: open the order, modify the order, hit stop loss or take profit, and so on. Just anything. It will signal you by the following ways: UseAlert=True - by alert in the window. UseComment=True - comments on the chart. UsePrint=False - write in log file. UseSendMail=False - by email. UseSound=True - by sound 12s.jpg 12s1.jpg 12s2.jpg 12s3.jpg |
|
||||
|
Only Open at specified time
Hi matrixbiz
this EA open trades at specified time, but not close at specified time. I'm looking for the same code ( close all orders at specified time ) to built in exist EA's. May be this help Quote:
|
|
||||
|
Hi Coders
I'm still learning by copy and past, because I'm a totally newbie. I need a function thats close all open trades at specified time. I have try something. Don't have any errors with compile. But with strategytester I have follow message: Testgenerator: unmatched data error(volume limit 719 at 2008.03.27 12:30 exeeded Testgenerator: unmatched data error(volume limit 135 at 2008.03.27 23:00 exeeded Black thats the original code. That works Blue thats what i i like to insert Thanks for any help //+-----------------------------------------------------------------------+ //| Check for close order conditions | //+-----------------------------------------------------------------------+ void CheckForCloseConditions() { int ticket; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break; if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue; if(OrderType()==OP_BUY) { if (GetSignal()==1) { OrderClose(OrderTicket(),OrderLots(),Bid,3,Red); return(0); } } if(OrderType()==OP_SELL) { if (GetSignal()==2) { OrderClose(OrderTicket(),OrderLots(),Ask,3,Red); return(0); } } } return(0); } //+-----------------------------------------------------------------------+ //| Check for close order conditions trailing | //+-----------------------------------------------------------------------+ void CheckForCloseConditionsTrailing() { int ticket; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break; if(OrderMagicNumber()!=MAGICMA_Trailing || OrderSymbol()!=Symbol()) continue; if(OrderType()==OP_BUY) { if (GetSignal()==1) { OrderClose(OrderTicket(),OrderLots(),Bid,3,Red); return(0); } if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } if(OrderType()==OP_SELL) { if (GetSignal()==2) { OrderClose(OrderTicket(),OrderLots(),Ask,3,Red); return(0); } if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderTakeProfit(),0,Magenta); return(0); } } } } } return(0); } //+-----------------------------------------------------------------------+ //| Start function | //+-----------------------------------------------------------------------+ int start() //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX //Close Open Orders by Time //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX if (UseCloseTime){ if (!(Hour()>=CloseTime && Hour()>=CloseTime)) { Comment("Time for close trade has come !"); return(0); } else Comment(""); }else Comment(""); { int ticket; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break; if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue; if(OrderType()==OP_BUY) { { OrderClose(OrderTicket(),OrderLots(),Bid,3,Red); return(0); } } if(OrderType()==OP_SELL) { { OrderClose(OrderTicket(),OrderLots(),Ask,3,Red); return(0); } } } return(0); } //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX //Close Open Trailing Orders by Time //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX if (UseCloseTime){ if (!(Hour()>=CloseTime && Hour()>=CloseTime)) { Comment("Time for close trailing trade has come !"); return(0); } else Comment(""); }else Comment(""); { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) //break; if(OrderMagicNumber()!=MAGICMA_Trailing || OrderSymbol()!=Symbol()) //continue; if(OrderType()==OP_BUY) { // if (GetSignal()==1) { OrderClose(OrderTicket(),OrderLots(),Bid,3,Red); return(0); } if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } if(OrderType()==OP_SELL) { { OrderClose(OrderTicket(),OrderLots(),Ask,3,Red); return(0); } if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderTakeProfit(),0,Magenta); return(0); } } } } } return(0); if(CalculateNumberOfOrders(Symbol())<1&&CalculateN umberOfOrdersTrailing(Symbol())<1) CheckForOpenConditions(); else { CheckForCloseConditions(); CheckForCloseConditionsTrailing(); } return(0); } Last edited by newdigital : 04-13-2008 at 01:21 PM. |
|
||||
|
Global variables?
hi matrixbiz
What's mean with "global scope"? The variables in begin of script to define the parameters of indicators ect? See attached # 1EA_Test_Template. I need this to test function of scripts. Let it run in strategytester and it works. Open Ea with MetaEditor and activate the inactive script after int start() Now compile and let it run in strategytester, the EA don't trade. See the error message in journal. |
|
||||
|
Scripts & Include file help
Do script & Include files need to be compiled?
If so, do they need the full works, or can they be treated the same as an exe file? (Down load/Close Metatrader/Re-open) Thanks guys
__________________
It ain't the length of the trend, it's what you do with it! |
|
||||
|
I do not know the language that is on KimIV. site but I managed to find the right file to down load but when I compile it there is an error
'GetParent' - function is not defined C:\Program Files\Straighthold Trader\experts\e-CloseByPercentProfit.mq4 (180, 10) Could some one please let him know or fix it if they have it |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/tools-utilities/174-close-all-open-tools.html
|
|||
| Posted By | For | Type | Date |
| Close all trades with a push of a button? | This thread | Refback | 07-21-2008 03:38 PM |
| Close all trades with a push of a button? | This thread | Refback | 07-21-2008 03:28 PM |
| Close all trades !!! | This thread | Refback | 06-24-2008 03:13 AM |
| Close all trades !!! | This thread | Refback | 06-19-2008 10:53 AM |
| Close all trades !!! | This thread | Refback | 06-19-2008 09:33 AM |
| Antara EA yang telah diLIVE test oleh MyMEFx Grup - Page 50 - Nogold.com | This thread | Refback | 12-05-2007 03:58 PM |
| skrypty close i modify | This thread | Refback | 08-07-2007 04:11 AM |
| Ind close sume post with one click? - Nogold.com | This thread | Refback | 06-30-2007 03:02 PM |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open/close trade on same bar's close? | WNW | Expert Advisors - Metatrader 4 | 2 | 03-29-2007 05:37 AM |
| close all open trades ea | G-Riper | General Discussion | 2 | 08-02-2006 09:41 PM |
| Close all open positions | jonjonau | Expert Advisors - Metatrader 4 | 6 | 07-12-2006 05:01 AM |
| Close All Open Positions? | lonespruce | Metatrader 4 | 9 | 06-22-2006 07:20 AM |