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
  #811 (permalink)  
Old 04-10-2008, 10:38 PM
Senior Member
 
Join Date: Feb 2006
Posts: 559
Michel is on a distinguished road
Quote:
Originally Posted by alimjan View Post
Code:
string OpenTrades(string mySymbol,double LotSize, double OpenPrice,int Type, double StopLoss, double TakeProfit,
 string ticketComment, void string MagicNum)
...
compiler error on : 'void' - parameter definition expected! ?????????
just delete "void".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #812 (permalink)  
Old 04-12-2008, 02:05 AM
Junior Member
 
Join Date: May 2007
Posts: 2
hopokuk is on a distinguished road
Trailing stop, initial stop

void ModifyOrder(double buyTS, sellTS) {
if (Bid - OrderOpenPrice() > buyTS * Point)
if (OrderStopLoss() < Bid - buyTS * Point) OrderModify(OrderTicket(), OrderOpenPrice(), Bid - buyTS * Point, OrderTakeProfit(), 0);
if (OrderOpenPrice() - Ask > sellTS * Point)
if (OrderStopLoss() > Ask + sellTS * Point) OrderModify(OrderTicket(), OrderOpenPrice(), Ask + sellTS * Point, OrderTakeProfit(), 0);
}



If the Trailing Stop is 40, the initial stop will be zero (orderopenprice)

I would like the initial stop to be 10 -

help please?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #813 (permalink)  
Old 04-12-2008, 10:41 PM
Junior Member
 
Join Date: Feb 2008
Posts: 1
kian is on a distinguished road
Cross Overs

DOES ANYONE KNOW HOW DO YOU WRITE WHEN TWO LINES CROSS OVER EACH OTHER
LETS SAY SAY IF 10 EMA IS ABOVE 20 EMA CONDTION 1
IF THAT CONDITION 1 IS THERE ....THEN TAKE A LONG WHEN STOCASTICS
D CROSSES ABOVE k
FOR D ABOVE K WE CAN USE D > K
WHAT DO YOU USE FOR D CROSS ABOVE k WHILE THE EMA CONDITION 1 IS IN PLACE?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #814 (permalink)  
Old 04-13-2008, 02:41 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,174
matrixebiz is on a distinguished road
Fix warning in EA

Hello, how do you fix this error in an EA?
'CloseHour' - expression on global scope not allowed
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #815 (permalink)  
Old 04-14-2008, 02:48 AM
syrndr's Avatar
Junior Member
 
Join Date: Apr 2008
Posts: 1
syrndr is on a distinguished road
Passing arrays between functions

Hi,

I am trying to pass arrays between function calls in my EA.

Here is the structure for my program.

I have the following files.

Helper.mq4
Code:
void writeLog(string[] orderLog)
{

   orderLog[0] = "Text1";
   orderLog[1] = "Text2";
   orderLog[2] = "Text3";

}
Helper.mqh
Code:
void writeLog(string[] orderLog);
EA.mq4
Code:
#include <Helper.mqh>

string OrderLog[24] = {"","","","","","","","","","","","","","","","","","","","","","","",""};

int init()
{

   writeLog(OrderLog);

   return(0);
}
When I run the above snippet of code, I get the following errors:

',' - left square parenthesis expected for array
',' - parameter expected
',' - incompatible types


However, if I do not use libraries and place these functions into the EA.mq4 file itself, the code works.

Does anyone know how to pass functions between functions in another library?

Your help would be much appreciated.
__________________
Thanks
Syrndr
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #816 (permalink)  
Old 04-15-2008, 07:41 AM
bradman's Avatar
Junior Member
 
Join Date: Oct 2006
Location: australia
Posts: 20
bradman is on a distinguished road
Help getting over problems in code!

This has been deleted!

Last edited by bradman; 04-24-2008 at 02:46 PM. Reason: It was just too stupid
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #817 (permalink)  
Old 04-15-2008, 08:38 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by syrndr View Post
Hi,

I am trying to pass arrays between function calls in my EA.
........
Code:
void writeLog(string & orderLog [] )
{
   orderLog[0] = "Text1";
   orderLog[1] = "Text2";
   orderLog[2] = "Text3";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #818 (permalink)  
Old 04-15-2008, 01:42 PM
etrade's Avatar
Senior Member
 
Join Date: Aug 2007
Posts: 266
etrade is on a distinguished road
Question sum of two indicators

Can an experienced coder tell me how to draw the numerical sum of two indicators ?

I mean modifying the codes of an indicators to add the value of another indicator to draw combination of two indicator values

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #819 (permalink)  
Old 04-15-2008, 05:37 PM
Member
 
Join Date: Sep 2007
Posts: 35
zamanib is on a distinguished road
buy and sell on the 100's

Can some one please write and EA to buy/sell on the round number eg gbp/jpy 201.00 203.00 etc. with target 100 pips no increase in lots size and no martangle. Thank you all very much. I have manualy doing it and gain profit every week. every month.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #820 (permalink)  
Old 04-16-2008, 12:23 AM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
Re: buy and sell on the 100's

Zamanib,
What are all the details you look at to decide whether to buy or sell?

Big Be
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:11 PM.



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