Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #581 (permalink)  
Old 12-17-2007, 11:04 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
No, sorry, I do not have enough time for now.
In few hours I take a boat to go back to my family for Xmas ... and no more pc...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #582 (permalink)  
Old 12-18-2007, 03:45 PM
Junior Member
 
Join Date: Oct 2007
Posts: 1
assasin is on a distinguished road
Hi all..

how can i set an order code in metaeditor,

i use demo account ... is it possible to set an order in demo account
i tried it but it failed
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #583 (permalink)  
Old 12-18-2007, 05:26 PM
Senior Member
 
Join Date: Sep 2006
Posts: 110
chawichsak is on a distinguished road
BE parameter

Hello.
I need help to add BE stop parameter in this EA please.This EA I got it from the first page of this thread that base on Trendmanager system.
Thank in advance.
Cha.

e-TrendManager.mq4
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #584 (permalink)  
Old 12-20-2007, 06:58 AM
Senior Member
 
Join Date: Sep 2006
Posts: 110
chawichsak is on a distinguished road
MQ4 file please

Hello.
I have this TrendmanagerEA text file.Could some one convert to MQ4 file please.I will test and compare with another EA.
Thank in advance.
Cha.

#property copyright "Copyright ฉ 2006, www.easyforexsignals.com"
#property link "paul@easyforexsignals.com"

#define LONGCOLOR DodgerBlue
#define SHORTCOLOR OrangeRed

#define MAGICTM 20070610

extern double TMlots=0.1;

extern int MoveStopAmount = 20;
extern int MoveStopAfterProfitof = 55;

extern int minadxlevel = 20;
extern double minSolarWind = 0.25;
extern double minJuice = 0.001;

extern int StopLoss=50,
Slippage = 3,
TakeProfit=120;

datetime LastTMSignalTime;
extern int MinTimeBetweenSignals = 60;


int init(){
return(0);
}
int deinit(){
return(0);
}


int start()
{
int res= 0;
if(Bars<100 || IsTradeAllowed()==false) return;

CheckTrendManager(); // check trend manager system
CheckForTMClose(); // check for closes on this system
CheckForStopMove(); // move stops on any open trades
}



void CheckForStopMove() {
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break;
if(OrderMagicNumber()!=MAGICTM || OrderSymbol()!=Symbol()) continue;

if(OrderType()==OP_BUY)
{
// move up stops to lock in profit
if ((OrderOpenPrice()-Ask) >= (MoveStopAfterProfitof * Point())) {
OrderModify(OrderTicket(),0,OrderOpenPrice()+(Move StopAmount*Point),OrderTakeProfit(),0,Black);
}
}
if(OrderType()==OP_SELL)
{
// move up stops to lock in profit
if ((OrderOpenPrice() - Bid) >= (MoveStopAfterProfitof * Point())) {
OrderModify(OrderTicket(),0,OrderOpenPrice()-(MoveStopAmount*Point),OrderTakeProfit(),0,Black);
}
}
}
}



void CheckTrendManager() {
if (Time[0]-LastTMSignalTime > MinTimeBetweenSignals) {
double PipsStopLoss, PipsTakeProfit;
double TMbuy = iCustom(Symbol(),Period(), "TrendManagerNT",2, 0);
double TMsell = iCustom(Symbol(),Period(), "TrendManagerNT",3, 0);
int orderresult;

if (TMbuy > 0) {
if (CheckFilters(OP_BUY)==true) {
PipsStopLoss = Ask-(StopLoss * Point());
PipsTakeProfit = Ask+(TakeProfit * Point());
CloseExisting(OP_SELL);
orderresult =OrderSend(Symbol(),OP_BUY,TMlots,Ask,Slippage,Pip sStopLoss, PipsTakeProfit,"",MAGICTM,0,Maroon);
Print(Time[0] + "BUY ON TM,order result was :" + orderresult + "stop:" + PipsStopLoss + ",takeprofit:" + PipsTakeProfit);
LastTMSignalTime = Time[0];
}
}

if (TMsell > 0){
if (CheckFilters(OP_SELL)==true) {

PipsStopLoss = Bid+(StopLoss * Point());
PipsTakeProfit = Bid-(TakeProfit * Point());
CloseExisting(OP_BUY);
orderresult = OrderSend(Symbol(),OP_SELL,TMlots,Bid,Slippage,Pip sStopLoss,PipsTakeProfit,"",MAGICTM,0,Green);
Print(Time[0] + "SELL ON TM, order result was :" + orderresult + "stop:" + PipsStopLoss + ",takeprofit:" + PipsTakeProfit);
LastTMSignalTime = Time[0];
}
}
}
}

void CheckForTMClose() {

double TMclosesell = iCustom(Symbol(),Period(), "TrendManagerNT",4, 0);
double TMclosebuy = iCustom(Symbol(),Period(), "TrendManagerNT",5, 0);


for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break;
if(OrderMagicNumber()!=MAGICTM || OrderSymbol()!=Symbol()) continue;
//---- just close it
if ((TMclosesell > 0) && (OrderType()==OP_SELL)) {
OrderClose(OrderTicket(),OrderLots(),Bid,10,Pink);
}
if ((TMclosebuy > 0) && (OrderType()==OP_BUY)) {
OrderClose(OrderTicket(),OrderLots(),Bid,10,Pink);
}
}

}


// just closes any existing positions
void CloseExisting(int OrderTyp)
{

for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false ) break;
if(OrderMagicNumber()!=MAGICTM || OrderSymbol()!=Symbol()) continue;
//---- just close it std slippage
if(OrderType()==OrderTyp)
{
OrderClose(OrderTicket(),OrderLots(),Bid,10,White) ;
}
}
}


bool CheckFilters(int OrderTyp) {
return(true);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #585 (permalink)  
Old 12-20-2007, 09:10 AM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
Just rename the file with .mq4 extension. That's all.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #586 (permalink)  
Old 12-20-2007, 01:10 PM
Senior Member
 
Join Date: Sep 2006
Posts: 110
chawichsak is on a distinguished road
Hello.
I try to change it but not work .Can you finish it for me please
Thank.
Cha.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #587 (permalink)  
Old 12-20-2007, 06:59 PM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Quote:
Originally Posted by chawichsak View Post
Hello.
I try to change it but not work .Can you finish it for me please
Thank.
Cha.
Done plut fixed a few bugs in the code.
Robert
Attached Files
File Type: mq4 TrendManager_EA.mq4 (4.1 KB, 52 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #588 (permalink)  
Old 12-20-2007, 07:14 PM
Junior Member
 
Join Date: Dec 2007
Posts: 4
fracte is on a distinguished road
Help needed for ordeersend function

Hello there,

I'm having trouble with the ordersend() function.

here is the code I made :
int x = 1;
int init()
{
return(0);
}
int deinit()
{
return(0);
}
int start()
{
double prixdachat = MathMax(High[1],High[2]);
double prixdevente = MathMin(Low[1],Low[2]);
int ticket1,ticket2;
if (x==1)
{
ticket1=OrderSend(Symbol(),OP_BUY,1,prixdachat+10* Point,5,prixdachat,prixdachat+20*Point,"ordre",1,1 5,Green);
ticket2=OrderSend(Symbol(),OP_SELL,1,prixdevente-10*Point,5,prixdevente,prixdevente-20*Point,"ordre",2,15,Red);
Print("order launched");
x++;
if(ticket1<0)
{
Print("OrderSend 1 failed with error #",GetLastError());
return(0);
}
if(ticket2<0)
{
Print("OrderSend 2 failed with error #",GetLastError());
return(0);
}
}
return(0);
}
With this code, I get the error #130 (error stops)

Can anyone explain me what is wrong, I don't understand...

thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #589 (permalink)  
Old 12-20-2007, 09:02 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
If you are using the so-called "Instant Execution", that means the use of OP_BUY or OP_SELL orders, you cannot specify an entry price other than Ask for Buys and Bid for Sells.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #590 (permalink)  
Old 12-20-2007, 09:18 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 722
Kalenzo is on a distinguished road
Quote:
Originally Posted by fracte View Post
Hello there,

ticket1=OrderSend(Symbol(),OP_BUY,1,prixdachat+10* Point,5,prixdachat,prixdachat+20*Point,"ordre",1,1 5,Green);
ticket2=OrderSend(Symbol(),OP_SELL,1,prixdevente-10*Point,5,prixdevente,prixdevente-20*Point,"ordre",2,15,Red);

[/indent]With this code, I get the error #130 (error stops)

Can anyone explain me what is wrong, I don't understand...

thanks.
USE PENDING ORDERS INSTEAD INSTANT ORDERS.
(eg. change OP_BUY FOR OP_BUYSTOP and OP_SELL FOR OP_SELLSTOP)
and it will be fine.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 01:36 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.