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
  #261 (permalink)  
Old 12-13-2007, 03:47 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 723
wolfe is on a distinguished road
Quote:
Originally Posted by Jovager View Post
In an EA, I have SL=50.

How change it to have SL=50 or crossing of 2 MAs ?

Thanks for help.

Jo
We would need to see your code to answer your question. It depends on how it is coded.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #262 (permalink)  
Old 12-18-2007, 02:50 PM
Junior Member
 
Join Date: Dec 2007
Posts: 4
fracte is on a distinguished road
Help needed for a Newbie

Hello !

I am currently learning MQl4, but I have a problem.

I want to code an EA that do a trade at a given time.

Here is the code I made :

#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern datetime temps = D'01.01.2007 00:00';
int init()
{
return(0);
}
int deinit()
{
return(0);
}
int start()
{
while (TimeCurrent()-temps<0)
{
}
OrderSend(...);
Print("order launched");
return(0);
}


The problem is : The EA is waiting the time to send the order, but after the time is come, I have plenty of orders that are launched, and it doesn't stop to send orders.

If someone can help me to understand what the problem is, it would be kind of you, because I do not understand and I don't know other ways to code this EA.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #263 (permalink)  
Old 12-19-2007, 01:20 AM
Junior Member
 
Join Date: Oct 2006
Posts: 11
capamando is on a distinguished road
Depth,Deviation,Backstep?

Hello,

Can someone explain how are the indicator parameters with a confused face next to them used?
SUPRESMultiFrame.mq4 |
//| |
//| RD |
//+------------------------------------------------------------------+
#property copyright "RD"
#property link "marynarz15@wp.pl"
#property indicator_chart_window
#define MaxObject 1000
//---- indicator parameters
extern int TimeFrame=5;
extern int BarsMax=89;
extern int ExtDepth=13;
extern int ExtDeviation=1;
extern int ExtBackstep=5;

Thanks

Last edited by capamando; 12-19-2007 at 01:22 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #264 (permalink)  
Old 12-21-2007, 08:24 PM
Junior Member
 
Join Date: Dec 2007
Posts: 2
thosecars82 is on a distinguished road
how to set stop loss and take profit when opening an order whose type is Market execu

Hello there
I have a problem setting the stoploss and takeprofit of some equities when I am opening orders. For some equities, when I try to open a new order, the dialog shows:

Symbol:...
Volume:...
Stop Loss:...
Comment:...
Type: "Market Execution"
and for other equities in the field Type it puts "Instant Execution" instead.

My problem comes when I try to open a new order whose field type contains "MarketExecution". In these cases, I cannot set the stoploss or the takeprofit at the time of opening the order because when I try, the dialog shows the message:
"Invalid S/L or T/P". For example, I try open buy with an equity whose Bid-Ask is 1.9800-1.9803 and try to put 1 as stop loss and 3 as takeprofit. Then I get the message: "Invalid S/L or T/P".
Therefore, I have to wait until the order is opened and then set the stoploss and takeprofit to the values I want but that seems really risky to me. I would prefer not to open any order without stoploss.

However, if the field type of the dialog of new order shows "Instant Execution" then when I try to set the stop loss and take profit, there is no problem at all and the order is opened with stop loss and take profit.

Would please anybody tell me what is happening here? I would appreciate if anybody could tell me how to open this kind of Market Execution orders with a stop loss and take profit without having to wait to put them until the order has been opened.
I look forward for your replies very soon.
Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #265 (permalink)  
Old 12-21-2007, 11:52 PM
Junior Member
 
Join Date: Dec 2007
Posts: 2
thosecars82 is on a distinguished road
Market Execution US Instant Execution

Hello there
Does anybody know any way to know from the inside of an expert advisor whether the order type for an equity is MarketExecution or InstantExecution? It is just because MarketExecution orders do not let put stop loss at the time of opening them. Otherwise an error message "Invalid S/L or T/P" is thrown in case you try to put the stop loss at the time of opening the Market Execution order.
Look forward your replies.
Thks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #266 (permalink)  
Old 12-26-2007, 07:39 AM
Junior Member
 
Join Date: Mar 2007
Posts: 11
samjesse is on a distinguished road
ObjectGet(StdDev,some_info)

Hi
I need to get the value of the StdDev channel upper/lower bounds at index n, is there a way?

many thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #267 (permalink)  
Old 12-27-2007, 10:23 PM
Junior Member
 
Join Date: Dec 2007
Posts: 4
inssuc is on a distinguished road
how to add coordinate line into seperate window?

hi,

there is a seperate window limited between 0 and 100, i want add a doted-coordinate line at 50, how to make?

-----------

i'v already know :-)

Last edited by inssuc; 12-27-2007 at 10:40 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #268 (permalink)  
Old 01-03-2008, 02:50 AM
Junior Member
 
Join Date: Jan 2008
Posts: 1
hans_dec is on a distinguished road
IndicatorCounted can be used to multipairs ?

Hi,
I just learn MT4 programming.
I read alot many EA source code using

counted_bars=IndicatorCounted();

I already read the documentation, there is no parameter in function IndicatorCounted, is very totally different like other function.

The problem is
How to deal with currency pairs which are different than the current chart currency (The chart that hosts the expert advisor)? For example, how to make an expert advisor that can get the GBPUSD's totals bar or USDCHF while the expert advisor is hosted on EURUSD chart ?
It's simple for another function like iMa, iRSI, etc, that have symbol parameter, but IndicatorCounted ??
Any tricks or solution for IndicatorCounted() function for multipairs ??

Many thanks
Hans
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #269 (permalink)  
Old 01-07-2008, 08:33 AM
Maury74's Avatar
Member
 
Join Date: Dec 2005
Posts: 46
Maury74 is on a distinguished road
Simple question...

Hi all,

I need help

How can I use the parameter "expiration" in a OrderSend function?

It doesn't seem to be the hour when the pending order will be deleted....if I put 21 (for example) my order will not deleted....

What is the right way to insert the expiration time???

Thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #270 (permalink)  
Old 01-07-2008, 09:15 AM
dealstone's Avatar
Junior Member
 
Join Date: Sep 2007
Posts: 14
dealstone is on a distinguished road
Quote:
Originally Posted by Maury74 View Post
Hi all,

I need help

How can I use the parameter "expiration" in a OrderSend function?

It doesn't seem to be the hour when the pending order will be deleted....if I put 21 (for example) my order will not deleted....

What is the right way to insert the expiration time???

Thanks

As I know some trade servers forbid using this parameter (if "exp">0).
__________________
De gustibus non est disputandum.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4, learning mql4

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 07:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 09:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 06:29 PM


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



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