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 Thread Tools Display Modes
  #411 (permalink)  
Old 10-13-2007, 05:57 PM
Junior Member
 
Join Date: Oct 2007
Posts: 1
vonokpasah is on a distinguished road
Unhappy I Need Help

I am appealing to the experts out there to please come to my aid i need some to help me buld an EXPERT ADVISER META 4 TRADER for me i would be greatfull if my request is granted.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #412 (permalink)  
Old 10-14-2007, 07:02 AM
Administrator
 
Join Date: Sep 2005
Posts: 15,943
Blog Entries: 64
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
Quote:
Originally Posted by vonokpasah View Post
I am appealing to the experts out there to please come to my aid i need some to help me buld an EXPERT ADVISER META 4 TRADER for me i would be greatfull if my request is granted.
Hi vonokpasah,

Just for information: we are having few very good threads with templates to create EAs and indicators. For example:

Templates to create EAs and Indicators:
- some good templates are here;
- templates with some new codes are here.
- Programming Modules with many programming functions are here.
- function of "mql4 code": thread with codes.

To use those templates and to create your own EA so you will need some very preliminary knowledge and it is basicly related to this thread http://www.forex-tsd.com/general-dis...der-forex.html

If you don't want to do some routine coding so you may automate this job: use this EA builder Expert Advisor Builder for MetaTrader 4 (it is free) and use this program Forex Trading with Gordago Forex Broker - Best Forex Software for Creating Forex Trading System! (I bought it for $9 long time ago - don't know about the price now). But to use those builders so you will need this thread first with Codersguru lessans http://www.forex-tsd.com/general-dis...der-forex.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #413 (permalink)  
Old 10-15-2007, 02:01 AM
jimven's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Upstate New York
Posts: 119
jimven is on a distinguished road
Using variables in an EA

Remember that any time you store data to temporary variables in an EA, the data will be gone if you reinitialize or restart the EA (or reboot your computer). This could have unexpected consequences regarding your trades. One possibility is that open trades will close, for example.

You can store data to Global Variables (using GlobalVariableSet and GlobalVariableGet). They remain in the terminal for two weeks (I think), even if undisturbed by your EA. But of course such data could quickly become just as problematic as lost data if you have a computer equipment problem.

In any event, your EA should be written defensively to prepare for loss of connection and the possibility of reinitialization.
__________________
Success is more perspiration than inspiration . . .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #414 (permalink)  
Old 10-15-2007, 03:41 PM
Senior Member
 
Join Date: Feb 2007
Posts: 175
Flytox is on a distinguished road
Good Day
i'am learning mql4 and have difficulties to understand some functions example:
Code:
 for( shift=limit; shift>=0; shift--)
   {
   double RSI = iRSI(NULL,0,RSILength,PRICE_CLOSE,shift);
   SmRSI[shift]= SmRSI[shift+1] + 2./(Smooth+1)*(RSI - SmRSI[shift+1]);  
   
      if(SmRSI[shift] > SmRSI[shift+1]) {double hRSI = SmRSI[shift]; double lRSI = SmRSI[shift+1];}
      else 
      if(SmRSI[shift] < SmRSI[shift+1]) {hRSI = SmRSI[shift+1]; lRSI = SmRSI[shift];}
      else
      {hRSI = SmRSI[shift]; lRSI = SmRSI[shift];}
   
   ATRRSI[shift] = hRSI - lRSI;
I don't see how it is possible to know SmRSI value with the following line, knowing that it has not been defined before and seems to me mathematically impossible.
Code:
SmRSI[shift]= SmRSI[shift+1] + 2./(Smooth+1)*(RSI - SmRSI[shift+1]);
Could anyone explain please.
PS: it's a pîece of code from Igorad trendstrength indi.
Thnaks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #415 (permalink)  
Old 10-15-2007, 05:41 PM
Senior Member
 
Join Date: Feb 2007
Posts: 175
Flytox is on a distinguished road
May be i understood the code above:
We can affect a value to smRsi because it use the same index then the iRsi().
Can someone confirm this ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #416 (permalink)  
Old 10-15-2007, 10:13 PM
jimven's Avatar
Senior Member
 
Join Date: Mar 2007
Location: Upstate New York
Posts: 119
jimven is on a distinguished road
Flytox:

I cannot find such code in my copy of TrendStrength.
Attached Files
File Type: mq4 TrendStrength_v1.1.mq4 (6.3 KB, 15 views)
__________________
Success is more perspiration than inspiration . . .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #417 (permalink)  
Old 10-16-2007, 08:32 AM
Senior Member
 
Join Date: Feb 2007
Posts: 175
Flytox is on a distinguished road
Quote:
Originally Posted by jimven View Post
Flytox:

I cannot find such code in my copy of TrendStrength.
It's TrendStrength v2.2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #418 (permalink)  
Old 10-16-2007, 08:58 PM
Member
 
Join Date: Jul 2007
Location: Frisco, Tx
Posts: 69
cochran1 is on a distinguished road
Custom Pricemode

Does anyone know how to make a custom pricemode ? I am using the following alert to signal when the price (extern int PriceMode = 6; //(high+low+close+close)/4) crosses a MA. I would like to make this custom by adding an offset, say 1 or 2 %. Is this possible ? Something like:

extern int PriceMode = ((high+low+close+close)/4) * 1.01


----------------------------------------------------
#property indicator_chart_window

extern int MA1.period =5; //Period 5
extern int MA1.shift=0;
extern int MA1.method=2; //SMMA
extern int lMA1.price=2; //MA set to candle high
extern int sMA1.price=3; //MA set to candle low
extern int PriceMode = 6; //(high+low+close+close)/4

int cBar,pBarLong,pBarShort;

int start()
{
cBar = Time[0];

if(CheckMACross(1)== 1 && cBar!=pBarLong ) {EmailAlert(1); pBarLong=cBar;}
else
if(CheckMACross(2)==-1 && cBar!=pBarShort) {EmailAlert(2); pBarShort=cBar;}
return(0);
}


int CheckMACross(int mode)
{
if(mode==1) int price = lMA1.price;
else
if(mode==2) price = sMA1.price;

double price1 = iMA(Symbol(),0,1,0,1,PriceMode,1);
double ma1 = iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, price,1);
double price0 = iMA(Symbol(),0,1,0,1,PriceMode,0);
double ma0 = iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, price,0);

if(ma1 > price1 && ma0 <= price0) return( 1);
else
if(ma1 < price1 && ma0 >= price0) return(-1);
else
return(0);
}

{
if(mode == 1) SendMail("Signal for LONG",Symbol()+" Go Long"); //SendMail
else
if(mode == 2) SendMail("Signal for SHORT",Symbol()+" Go Short");//SendMail
}
int lastBAlert = 0;
int lastSAlert = 0;

void EmailAlert(int mode)
{
if(mode == 2 && lastSAlert < Time[0] )
{
SendMail("Go Short 1",Symbol()+" Go Short 1"); //SendMail
lastSAlert = Time[0];
}
}

Last edited by cochran1; 10-16-2007 at 09:36 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #419 (permalink)  
Old 10-17-2007, 01:04 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 681
wolfe is on a distinguished road
Quote:
Originally Posted by vonokpasah View Post
I am appealing to the experts out there to please come to my aid i need some to help me buld an EXPERT ADVISER META 4 TRADER for me i would be greatfull if my request is granted.
Millions of ways to build an expert, what way were you thinking?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #420 (permalink)  
Old 10-17-2007, 06:10 AM
Member
 
Join Date: Jul 2006
Posts: 32
agarwalsharma is on a distinguished road
source code help!

Hello all

I have an EA and i want to add an input to it

If take profit >= :xx , buy :xx lot

extern int Deltaopen1 =100;


I wrote;

if (type == OP_BUY)
{
if (M2.BuyCnt == 0 && OrderTakeProfit() > OrderOpenPrice() + Deltaopen1*point)
{
Buy(Symbol(), GetLots2(), Ask, 0, 0, Magic2);
return;
}
}

if (type == OP_SELL)
{
if (M2.SellCnt == 0 && OrderTakeProfit() <= OrderOpenPrice() - Deltaopen1*point)
{
Sell(Symbol(), GetLots2(), Bid, 0, 0, Magic2);
return;
}
}
}


But it does not work,

I appreciate any help.

Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 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 06:56 AM.



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