Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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 (1) Thread Tools Display Modes
  #941 (permalink)  
Old 05-20-2008, 10:40 AM
Senior Member
 
Join Date: May 2006
Posts: 147
waltini is on a distinguished road
KuPretMan

Have a look at these two EA's.
Attached Files
File Type: mq4 Martingale.mq4 (2.6 KB, 5 views)
File Type: mq4 MasterMartingaleOriginal.mq4 (6.3 KB, 6 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #942 (permalink)  
Old 05-20-2008, 11:57 AM
Junior Member
 
Join Date: Dec 2006
Posts: 16
OxiG is on a distinguished road
move tp and sl...

hello, i need some help regarding the mt4 programming, hope friends in here can help me...
----------

Int StopLoss = 20;
// 1st ticket
OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-StopLoss*Point,Ask+15*Point,
“buy”,MagicNumber,0,Aqua);OrderTime = Time[0];

// 2nd ticket
OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-StopLoss*Point,Ask+30*Point,
“buy”,MagicNumber,0,Aqua);OrderTime = Time[0];

// 3rd ticket
OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-StopLoss*Point,Ask+100*Point,
“buy”,MagicNumber,0,Aqua);OrderTime = Time[0];


--------
Let say from above programming, three tickets were open in a same time,
1. If 1st ticket profit, how to add program/modify StopLoss for 2nd and 3rd ticket at open price?
2. If 2nd ticket profit, how to add program/modify StopLoss for 3rd ticket at 1st target profit?
3. How to program to calculate the profit of all ticket after the trades are closed?
__________________
--------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #943 (permalink)  
Old 05-20-2008, 11:12 PM
Junior Member
 
Join Date: Oct 2006
Posts: 24
natsirte is on a distinguished road
how to include a file.txt in an mq4 file ??

Hi everybody



I've got a file (var.txt) with some variables



//************var.txt*********************//

double high_d1 = iHigh(NULL, PERIOD_D1, Current + 0);
double low_d1 = iLow(NULL, PERIOD_D1, Current + 0);
double highp1_d1 = iHigh(NULL, PERIOD_D1, Current + 1);
double lowp1_d1 = iLow(NULL, PERIOD_D1, Current + 1);



double sto14 = iStochastic(NULL, 0, 14, 3, 5, MODE_EMA, 0, MODE_MAIN, Current + 0);
double sto14s = iStochastic(NULL, 0, 14, 3, 5, MODE_EMA, 0, MODE_SIGNAL, Current + 0);


double sar = iSAR(NULL, 0, 0.02, 0.2, Current + 0);
double open = iOpen(NULL, 0, Current + 0);
double close = iClose(NULL, 0, Current + 0);



//*******************************//



and I want to put this file in an mq4 file (test.mq4) with the fonction "include" like this



#include <var.txt>



But the programm return this message : " #include <var.txt> cannot open the programm file"

Is it possible to do that ? and how?



Thanks in advance for your help!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #944 (permalink)  
Old 05-21-2008, 12:29 AM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 347
cockeyedcowboy is on a distinguished road
yes, were are you putting your file. It has to be located in your include directory for it to be seen if your using the < > brakets. If your puting your include file in the main EA directory or in the indicator directory then you must use " " instead of the < >.


Keit
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #945 (permalink)  
Old 05-21-2008, 09:23 PM
nondisclosure007's Avatar
Senior Member
 
Join Date: Apr 2007
Posts: 100
nondisclosure007 is on a distinguished road
Can't find }}'s! Help!

Can someone help me find where I'm missing the }}'s? If I add them to the end, it'll compile, but I can't find where I'm missing them.

Thanks!

Never minde. Found it.

Last edited by nondisclosure007; 05-21-2008 at 11:35 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #946 (permalink)  
Old 05-21-2008, 10:15 PM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
KuPretMan

Quote:
Originally Posted by waltini View Post
Have a look at these two EA's.
Tell us why.

Big Be
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #947 (permalink)  
Old 05-22-2008, 07:39 AM
clarc's Avatar
Junior Member
 
Join Date: May 2006
Posts: 19
clarc is on a distinguished road
@ FerruFX

1.) i try to explain my ideas for the entry/exit moneymanagment in the next days, please send me your email per MP (but its not easy, im not a "native english speaker"...)

2.) could you look over the EA once more - the control function works great, but now this function will avoid that the EA switch the position from long to short ore short to long by itself if a new signal comes out - the EA will now only entry into a trade, if the position is stopped out or reached its take profit, but often the EA should switch after a period of time. is it possible to get the "switch position" function working beneth the "control function" ?

i hope you can understand what im trying to tell..

thank you for the help

clarc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #948 (permalink)  
Old 05-22-2008, 09:32 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Quote:
Originally Posted by clarc View Post
@ FerruFX

please send me your email per MP
I sent you a PM 2 days ago.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #949 (permalink)  
Old 05-22-2008, 10:11 AM
clarc's Avatar
Junior Member
 
Join Date: May 2006
Posts: 19
clarc is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
I sent you a PM 2 days ago.

FerruFx
oh yes, i havent noticed that until now.... sorry, i will answer @ weekend, could you look into the EA because of the "position switch" problem ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #950 (permalink)  
Old 05-22-2008, 10:23 AM
clarc's Avatar
Junior Member
 
Join Date: May 2006
Posts: 19
clarc is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
I sent you a PM 2 days ago.

FerruFx
you got mail ;-)

Last edited by clarc; 05-22-2008 at 05:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 07:24 AM

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 12:07 PM.



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