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
  #771 (permalink)  
Old 03-20-2008, 03:17 AM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 2,826
Blog Entries: 34
Linuxser has disabled reputation
Quote:
Originally Posted by star90 View Post
Hi,
I want to know how can I refer to a filename that I am running.
For example if I run a script called supertrader.mq4 and I want to open a logfile called supertrader_logfile from the script supertrader.
Is there a variable that holds the name of the file I am running?
Thanks.
Maybe by adding void Print( ...) to the script.

void Print( ...) Prints a message to the experts log.
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #772 (permalink)  
Old 03-21-2008, 05:43 AM
Member
 
Join Date: Oct 2006
Posts: 69
Big Be is on a distinguished road
To adria

Did you see my PM?

Big Be
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #773 (permalink)  
Old 03-21-2008, 08:07 AM
richman's Avatar
Junior Member
 
Join Date: Jun 2007
Posts: 11
richman is on a distinguished road
Wolf Wave. I need your help

Dear Codersguru,

I am not a programmer and in my trial and error style, the wolf wave I tried to improve is giving the signal " the second parameter, ObjectTextSetFunction must be a string.

Please help me to rectify.

Thank you in anticipation.
Attached Files
File Type: rar WolfWave.rar (2.4 KB, 18 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #774 (permalink)  
Old 03-23-2008, 10:35 PM
nittany1's Avatar
Senior Member
 
Join Date: Dec 2006
Location: Sarasota, FL
Posts: 184
nittany1 is on a distinguished road
Hi guys I need a bool function that returns true if 5 mins has passed, or 10 mins or whatever. I know how to check for a new bar already but its not often enough.
__________________
You can find me on irc.ircforex.com most of the time... on #forex
Myspace Facebook My Indicators: Trade Assistant Trend Friend ToR CCI Helper
Holder of US Patent 6,774,788
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #775 (permalink)  
Old 03-23-2008, 11:08 PM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 2,826
Blog Entries: 34
Linuxser has disabled reputation
Quote:
Originally Posted by nittany1 View Post
Hi guys I need a bool function that returns true if 5 mins has passed, or 10 mins or whatever. I know how to check for a new bar already but its not often enough.
Maybe

Code:
double LastRedraw = 0;

if(TimeLocal() - LastRedraw > 300)          
{
Print();

ObjectsRedraw(); 
Print("ObjectsRedraw Done");
LastRedraw = TimeLocal();
}
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #776 (permalink)  
Old 03-24-2008, 02:23 AM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
Quote:
Originally Posted by Linuxser View Post
Maybe

Code:
double LastRedraw = 0;

if(TimeLocal() - LastRedraw > 300)          
{
Print();

ObjectsRedraw(); 
Print("ObjectsRedraw Done");
LastRedraw = TimeLocal();
}
Or this:

Code:
bool ElapsedTimeCheck(int MyMinutes)
{
 static datetime OldTime;
 
 if (OldTime == 0)
  OldTime = TimeCurrent() + MyMinutes * 60; // initialised once...

 if (TimeCurrent() >= OldTime) 
 {
  OldTime = TimeCurrent() + MyMinutes * 60;
  bool cond = true;
 }
 else cond = false;
 
 return(cond);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #777 (permalink)  
Old 03-24-2008, 06:32 AM
nittany1's Avatar
Senior Member
 
Join Date: Dec 2006
Location: Sarasota, FL
Posts: 184
nittany1 is on a distinguished road
Cool thanks guys, both of the suggestions are probably better than what I was working on.
__________________
You can find me on irc.ircforex.com most of the time... on #forex
Myspace Facebook My Indicators: Trade Assistant Trend Friend ToR CCI Helper
Holder of US Patent 6,774,788
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #778 (permalink)  
Old 03-24-2008, 07:48 PM
Junior Member
 
Join Date: Mar 2007
Posts: 5
biosq is on a distinguished road
Somebody please help me....

Hi...

I hope somebody here can help me how to code this.This is martiangle EA and what i want to do is:

1 . When 2nd layer post open,i want target point at 1st layer move to target point 2nd layer.So when target point hit at 2nd layer ,that 2 post can close at same time.If 3rd layer is open,that 1st and 2nd layer target point can move to 3rd target point price.So we can close at same time.Same happend if 4th layer,5th layer and other layer open.Just need move all Target Point to current layer Target Point or post.

2.Need pips lock.When 1st layer open,and got profit example 15 pip (TP 32),the ea make locking at sl price(example 5 pip)So when price reversel 10 pip that post can close automatically with profit 5 pips.Just for 1st layer post only.2nd layer do not need activated because this martiangle EA.

I m very sorry for my bad english.Hope someone can help me with put a code at this EA. Thank You



Martiangle RSI .mq4


Regards

Really Need Help Person
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #779 (permalink)  
Old 03-25-2008, 07:39 PM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 294
Beno is on a distinguished road
Comment help please

I am trying to set up a comment to show on screen but not having much luck
I have managed to get the pip count for a single pair but I can't seem to show the collated total for multiple pairs

Any help would be great

this is an example of that code

//========== FUNCTION getPipValue
double getPipValue(double ord,int dir)
{
double val;
RefreshRates();
if(dir == 1) val=(NormalizeDouble(ord,Digits) -
NormalizeDouble(Ask,Digits));
else val=(NormalizeDouble(Bid,Digits) - NormalizeDouble(ord,Digits));
val = val/Point*co;
return(val);
}
//== end function

int getSpread()
{
int spread=MarketInfo(Symbol(),MODE_SPREAD);
return(spread);
}



//========== FUNCTION getOpenOrders
void getOpenOrders()
{
int nsl, nsd;
string mngMagic, trailon;
int totalorders = OrdersTotal();
for(int j=0; j<totalorders;j++)
{
OrderSelect(j, SELECT_BY_POS, MODE_TRADES);
if((OrderType() == OP_BUY || OrderType() == OP_SELL) &&
OrderSymbol() == Symbol()&&(MagicNumber==0 || MagicNumber ==
OrderMagicNumber()))
{

double val=getPipValue(OrderOpenPrice(),OrderType());
//int val = OrderProfit()/(OrderLots()*10);



}

if(MagicNumber == 0)
mngMagic = "All "+Symbol()+" trades.";
else
mngMagic = "Trades with magic number = "+MagicNumber;




//RefreshRates();
Comment("Balance: ",AccountBalance(),", Account Equity: ",AccountEquity(),", Account Profit: ",AccountProfit(),"Order Open: ",OrderOpenPrice(),
"\nPip Count: ", val,
"\nMy Account Cutoff Limit: ",Open_Loss_To_CloseTrades,
"\nManaging: ", mngMagic);



Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #780 (permalink)  
Old 03-25-2008, 07:55 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
The pips value of a current order may be obtained by the following:
PHP Code:
OrderClosePrice() - OrderOpenPrice() ) / MarketInfoOrderSymbol(), MODE_POINT 
If you want to use "bid" and "ask", you also need to use the ones related to the order symbol, i.e. MarketInfo( OrderSymbol(), MODE_BID ) and MarketInfo( OrderSymbol(), MODE_ASK ).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
CHinGsMAroonCLK, I_XO_A_H

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 06: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 04:22 PM


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



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