Forex
Google

Go Back   Forex Trading > Programming > Metatrader Programming
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 Thread Tools Display Modes
  #521 (permalink)  
Old 12-05-2007, 11:20 PM
wasanmyza wasanmyza is offline
Junior Member
 
Join Date: Nov 2007
Posts: 2
wasanmyza is on a distinguished road
Help Me Ea

I Don't Speak English,I want to add Maxtrade And Risk Do you help me
Thankyou
Attached Files
File Type: mq4 Zero.mq4 (9.2 KB, 22 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #522 (permalink)  
Old 12-06-2007, 12:16 AM
Strangguy Strangguy is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Strangguy is on a distinguished road
Quote:
Originally Posted by wasanmyza View Post
I Don't Speak English,I want to add Maxtrade And Risk Do you help me
Thankyou
Hi,
You have other issues with this EA. You are stating that you would like to make a buy or sell when VAR1, VAR2 or VAR3 has reached or exceeded certain values.
You must first define what is VAR1, 2 and 3? Some indicator with specific settings?

Thanks,
StrangeGuy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #523 (permalink)  
Old 12-06-2007, 07:10 AM
Mango Boy Mango Boy is offline
Junior Member
 
Join Date: Apr 2007
Posts: 5
Mango Boy is on a distinguished road
Take Profit, cancel all other orders

Does anyone know how to code once the open order hit profit target, the rest of the pending orders will be deleted? It is different from oco. I have checked the elite section, but nothing there.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #524 (permalink)  
Old 12-06-2007, 05:47 PM
nakata79087 nakata79087 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
nakata79087 is on a distinguished road
question

I do not understand the difference of two programs, but would teach it?


int limit = Bars-IndicatorCounted();
int i ;
for( i=limit-1; i>=0; i--)




int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #525 (permalink)  
Old 12-06-2007, 07:28 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 509
Michel is on a distinguished road
Quote:
Originally Posted by nakata79087 View Post
I do not understand the difference of two programs, but would teach it?


int limit = Bars-IndicatorCounted();
int i ;
for( i=limit-1; i>=0; i--)




int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++)
The most important difference is the direction of the "for" loop:
The first one scan the bars following the natural time, ie from the oldest to the newest bar.
The second one scan the bars in the opposite direction: it can work if the calcul of a bar doesn't involve the result of the previous bar;
In general it's better to use the same direction as the time: it always works and there are no possibilties of mistaken.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #526 (permalink)  
Old 12-07-2007, 05:11 AM
nakata79087 nakata79087 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
nakata79087 is on a distinguished road
Thank you

thank you for your kind,Michel!!

I was troubled for a long time,why it start a different signature though two these are slight differences.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #527 (permalink)  
Old 12-07-2007, 06:13 AM
nakata79087 nakata79087 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 6
nakata79087 is on a distinguished road
Other question

now my EA like this

if(FastMA2 <= SlowMA2 && FastMA1 > SlowMA1)
{
ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-SLpips*Point,Ask+(45*Point),"",MAGIC,0,Blue);
return(0);


i want to change like this

1. 15minutus timeflame happen buy sign

2. if then 5minutes timeflame MA cross buy sign already ,too
ClosePosition. and get new position

if then 5minutes timeflame MA change sell sign already
wait 5minutes timeflame change buy sign ,
then ClosePosition. and get new position


Please tell me how to write this program.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #528 (permalink)  
Old 12-07-2007, 03:58 PM
EliteJ's Avatar
EliteJ EliteJ is offline
Junior Member
 
Join Date: Nov 2006
Posts: 11
EliteJ is on a distinguished road
Need help with coding ease of movement indicator

I tried to code it myself but the indicator line doesn't show in the indicator window when I run it. If you go here MANUAL - TECHNICAL INDICATORS it has a definition of the indicator with the formula for calculating it.

Here's the code I have written:

//+------------------------------------------------------------------+
//| Ease of Movement.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_minimum -50
#property indicator_maximum 50
#property indicator_buffers 1
#property indicator_color1 Yellow
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
string short_name = "Ease of Movement";
IndicatorShortName(short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----check for errors
if (counted_bars<0) return(-1);

//----last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int k = Bars - counted_bars;
double midptT, midptY, boxR, midptM, EMV;
while (k>0)
{
midptT = (High[k] + Low[k])/2;
midptY = (High[k+1] + Low[k+1])/2;
midptM = midptT - midptY;
boxR = Volume[k]/(High[k] - Low[k]);
EMV = midptM / boxR;
ExtMapBuffer1[k] = EMV;
k--;
}

return(0);
}
//+------------------------------------------------------------------+


can anyone tell me what I'm doing wrong? I attached the indicator too if you want to try to run it for yourself.
Attached Files
File Type: mq4 Ease of Movement.mq4 (2.2 KB, 12 views)
__________________
"Duct tape is like the force: it has a dark side and a light side, and it holds the universe together."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #529 (permalink)  
Old 12-07-2007, 04:55 PM
Beno's Avatar
Beno Beno is offline
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 249
Beno is on a distinguished road
Hello

I am looking for some help I have an EA that I'm using on demo and also learning to code with. I am trying to figure out how to add a comment to the system to show me which of the 4 entry criteria was used to open the position. eg if long2 was used then show long2 signal

any help would be great


cheers

Beno
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #530 (permalink)  
Old 12-07-2007, 09:39 PM
wolfe's Avatar
wolfe wolfe is offline
Senior Member
 
Join Date: Jan 2006
Posts: 673
wolfe is on a distinguished road
Quote:
Originally Posted by Beno View Post
Hello

I am looking for some help I have an EA that I'm using on demo and also learning to code with. I am trying to figure out how to add a comment to the system to show me which of the 4 entry criteria was used to open the position. eg if long2 was used then show long2 signal

any help would be great


cheers

Beno
After your condition is met and you use Ordersend() command, just insert a Comment(), Alert(), or Print() statement. Whichever you want to use.

Something like this:

if ( long2 == true)
{
Ordersend();
{
Print(" long2 signal taken ");
}
}


Hope that helps.
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


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


All times are GMT. The time now is 08:28 AM.