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
  #281 (permalink)  
Old 01-21-2008, 01:23 PM
Junior Member
 
Join Date: Sep 2007
Posts: 1
br001 is on a distinguished road
Expert Advisor running on Custom Timeframe.It's Possible?

Hello!


I woud like running expert advisor in 20M timeframe.I try the PeriodConverter indicator,but when i try to use the expert advisor nothing happend.
The 20M chart is in live mode.

Somebody tell me what is the problem,and what is the solution?


Sorry for my English.
Thanks,
Br001
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #282 (permalink)  
Old 01-21-2008, 01:39 PM
Member
 
Join Date: Sep 2006
Posts: 56
sbwent is on a distinguished road
i-FractalsEx EA

I hope someone can help me. I am trying to write an EA that includes this Indicator but I don't know how to include it in an EA. I have a start but it doesn't return any values. I'd like return a High and Low value at the time an arrow is drawn on the chart and open a trade.

FracHi=iCustom(NULL,0,"i-FractalsEx",Fr.Period,MaxBars,0,0);
FracLow=iCustom(NULL,0,"i-FractalsEx",Fr.Period,MaxBars,1,0);

It works when I use the built in Fractals:
FracHi=iFractals(NULL, 0, MODE_UPPER, 3);
FracLow=iFractals(NULL, 0, MODE_LOWER, 3);

These return a High and Low value at the time an arrow is drawn on the chart. From this I can set it to open a trade.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #283 (permalink)  
Old 01-24-2008, 12:05 AM
MANSTIR's Avatar
Member
 
Join Date: Nov 2007
Posts: 95
MANSTIR is on a distinguished road
tell me what is the problem of my trailing stop, if position long/buy its seems ok and its modify stoploss always as i stated the change every 10 pips.. now the problem is when the ea do sell/short.. there's no trailing stop and also modify stoploss...someone can help me, pleass ... here the example;

for(cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)
{
if (OrderType()==OP_SELL)
{
if (TrailingStop>0)
{
if (OrderOpenPrice()-Ask>=(TrailingStop*Point+Pips*Point))
{
if (OrderStopLoss()>(Ask+Point*TrailingStop))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderClosePrice()-TakeProfit*Point-TrailingStop*Point,800,Purple);
return(0);
}
}
}
}

if (OrderType()==OP_BUY)
{
if (TrailingStop>0)
{
if (Bid-OrderOpenPrice()>=(TrailingStop*Point+Pips*Point))
{
if (OrderStopLoss()<(Bid-Point*TrailingStop))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderClosePrice()+TakeProfit*Po int+TrailingStop*Point,800,Yellow);
return(0);
}
}
}
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #284 (permalink)  
Old 01-24-2008, 04:35 AM
Senior Member
 
Join Date: Dec 2005
Location: In front of my trading desk
Posts: 344
Devil2000 is on a distinguished road
Quote:
Originally Posted by MANSTIR View Post
tell me what is the problem of my trailing stop, if position long/buy its seems ok and its modify stoploss always as i stated the change every 10 pips.. now the problem is when the ea do sell/short.. there's no trailing stop and also modify stoploss...someone can help me, pleass ... here the example;

.......................
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderClosePrice()-TakeProfit*Point-TrailingStop*Point,800,Purple);
.......................
We can't set any expiration time on market order.
__________________
Need a professional MQL4 programmer? PM me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #285 (permalink)  
Old 01-24-2008, 07:04 AM
MANSTIR's Avatar
Member
 
Join Date: Nov 2007
Posts: 95
MANSTIR is on a distinguished road
Quote:
Originally Posted by Devil2000 View Post
We can't set any expiration time on market order.
thats mean i need to delete the '800', right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #286 (permalink)  
Old 01-24-2008, 07:43 AM
Senior Member
 
Join Date: Dec 2005
Location: In front of my trading desk
Posts: 344
Devil2000 is on a distinguished road
Quote:
Originally Posted by MANSTIR View Post
thats mean i need to delete the '800', right?
That's what I mean
__________________
Need a professional MQL4 programmer? PM me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #287 (permalink)  
Old 01-24-2008, 11:31 PM
MANSTIR's Avatar
Member
 
Join Date: Nov 2007
Posts: 95
MANSTIR is on a distinguished road
Quote:
Originally Posted by Devil2000 View Post
That's what I mean
thanks devil2000 for ya help, i try to delete only 800 but its wont work too

i try backtest and the result are same as before...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #288 (permalink)  
Old 01-25-2008, 09:05 AM
Senior Member
 
Join Date: Dec 2005
Location: In front of my trading desk
Posts: 344
Devil2000 is on a distinguished road
Quote:
Originally Posted by MANSTIR View Post
thanks devil2000 for ya help, i try to delete only 800 but its wont work too

i try backtest and the result are same as before...
Is there any error message on your journal?

What are the "TrailingStops" and "Pips" default value?
__________________
Need a professional MQL4 programmer? PM me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #289 (permalink)  
Old 01-27-2008, 02:10 PM
Junior Member
 
Join Date: Jan 2008
Posts: 23
TraderGuy is on a distinguished road
Close partial position?

Hi, this is my first post here, and I'm a MetaTrader newbie, so, if I ask a dumb question, sorry. I've looked through some of the newbie materials, and haven't yet found an answer to what should hopefully be a trivial question: how do you close part of a position?

If I right-click on a position, it has things like close or modify. And modify allows me to change stop and limit. But, I don't see it having an option to change the number of lots I have.

So, I figured maybe if I put in a reverse order, like put in a sell order if I was going long or vise-versa. What I got in that case was two open positions, one long and one short for the same pair!

I'm at FXDD if that makes any difference. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #290 (permalink)  
Old 01-27-2008, 02:17 PM
Junior Member
 
Join Date: Jan 2008
Posts: 23
TraderGuy is on a distinguished road
Scripts actually work?

Another stupid newbie question, I'm sure. I've read through Coderguru's MQL4 tutorial. He has a sample advisor and a sample indicator. Didn't have much about scripts. But, MetaTrader came with a few scripts. Like, "trade". I attempt to run it, and I get a prompt that asks me if I'm sure I want to buy the pair. I say yes, and nothing happens. Or, I run "close". It asks me if I want to attach "close" to my chart. I say yes, and nothing happens. I attached it to a chart of an open position, so, I would think that it should have closed that position.

Which brings me to another question. Scripts seem to "attach" to charts. I was wondering if there was capability to "attach" to a position? Like, in my post of a minute ago, I asked how to close half a position. Although I'm sure there must be an easy way to do it without needing a script, but, if I wanted a script, would there be a way that I could click on a position that I have, tell it to run a "close_half" script and have it close half of the position?

I'm at FXDD if that is of any relevance. Again, sorry for newbie question.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
close, eas, learn mql4 video, profit, reach

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 06:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 08:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 05:29 PM


All times are GMT. The time now is 08:32 PM.



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