Forex
Google

Go Back   Forex Trading > Downloads > Tools and utilities
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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

Reply
 
LinkBack (8) Thread Tools Display Modes
  #121 (permalink)  
Old 04-08-2008, 12:43 AM
Linuxser's Avatar
Linuxser Linuxser is offline
Moderator
 
Join Date: May 2006
Location: Helliconia (Autumn)
Posts: 2,193
Linuxser has disabled reputation
Quote:
Originally Posted by WNW View Post
These great scripts are courtesy of smjones at ForexFactory.
I took the liberty of renaming them.
Thank you WNW
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #122 (permalink)  
Old 04-11-2008, 01:31 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,429
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #123 (permalink)  
Old 04-13-2008, 12:08 AM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,043
matrixebiz is on a distinguished road
EA to close all orders

I've seen EA/Scripts that close all open orders but I'm looking for and EA to close all open orders at a specified time. Anyone have an EA like this?
or can someone show me what code to change on an EA that opens orders to add code to close and order.

Thank you

EDIT: if anyone has an EA that Opens an order at a specified time then closes the order at another time can someone post here please.

Last edited by matrixebiz : 04-13-2008 at 01:12 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #124 (permalink)  
Old 04-13-2008, 08:44 AM
Badguy's Avatar
Badguy Badguy is offline
Member
 
Join Date: Jan 2006
Posts: 40
Badguy is on a distinguished road
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:
Originally Posted by matrixebiz View Post
I've seen EA/Scripts that close all open orders but I'm looking for and EA to close all open orders at a specified time. Anyone have an EA like this?
or can someone show me what code to change on an EA that opens orders to add code to close and order.

Thank you

EDIT: if anyone has an EA that Opens an order at a specified time then closes the order at another time can someone post here please.
Attached Files
File Type: mq4 e-OpenByTime.mq4 (11.0 KB, 19 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #125 (permalink)  
Old 04-13-2008, 01:00 PM
Badguy's Avatar
Badguy Badguy is offline
Member
 
Join Date: Jan 2006
Posts: 40
Badguy is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #126 (permalink)  
Old 04-13-2008, 01:23 PM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,043
matrixebiz is on a distinguished road
How do you fix a "'CloseHour' - expression on global scope not allowed" error?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #127 (permalink)  
Old 04-13-2008, 03:56 PM
Badguy's Avatar
Badguy Badguy is offline
Member
 
Join Date: Jan 2006
Posts: 40
Badguy is on a distinguished road
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.

Quote:
Originally Posted by matrixebiz View Post
How do you fix a "'CloseHour' - expression on global scope not allowed" error?
Attached Files
File Type: mq4 # 1EA_Test_Template v1.mq4 (12.2 KB, 4 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #128 (permalink)  
Old 04-14-2008, 07:51 AM
BigBaloo's Avatar
BigBaloo BigBaloo is offline
Member
 
Join Date: Nov 2007
Location: White Water BC
Posts: 63
BigBaloo is on a distinguished road
Scripts & Include file help

Quote:
Originally Posted by Dimicr View Post
They send orders very sure!
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #129 (permalink)  
Old 04-15-2008, 02:43 PM
BigBaloo's Avatar
BigBaloo BigBaloo is offline
Member
 
Join Date: Nov 2007
Location: White Water BC
Posts: 63
BigBaloo is on a distinguished road
Help with this EA

Hi,
Any kind Coder like to add a Breakeven option to this Indicator?
Blessings, & kind thoughts always with you!
Thanks
Attached Files
File Type: mq4 e-OpenByTime.mq4 (16.9 KB, 8 views)
__________________
It ain't the length of the trend, it's what you do with it!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #130 (permalink)  
Old 04-15-2008, 05:24 PM
Beno's Avatar
Beno Beno is offline
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 249
Beno is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT. The time now is 07:22 AM.