Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (2) Thread Tools Display Modes
  #691 (permalink)  
Old 07-29-2007, 02:32 PM
Junior Member
 
Join Date: Mar 2007
Posts: 10
Hartadi is on a distinguished road
@Michel :

Oh my god... how stupid i am..
thank you..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #692 (permalink)  
Old 08-01-2007, 05:01 AM
Junior Member
 
Join Date: Jul 2007
Posts: 3
Benjimang is on a distinguished road
Help with hedging

Hi everyone!

I have used the Expert Advisor Builder at sufx.com to create an EA. It has two limitations that I am trying to get rid of:

1. only opens 1 trade at a time. I can get it to have two trades open at once, but I can't get it to open a buy order and a sell order simultaneously.

2. seems to take sell orders as a preference over buy orders. This wouldn't really be an issue if problem number 1 was solved.

Here is the peice of code that seems to be holding me up:

Code:
   //Check position
   bool IsTrade = False;
   
   for (int i = 0; i < Total; i ++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if (OrderType() <= OP_SELL &&  OrderSymbol() == Symbol()) {
            IsTrade = True;
      if (OrderType() == OP_BUY) {
            //Close
Any suggestions? I'd like to let it open as many trades as possible, and be able to open buy and sell orders simultaneously if the indicators say so.

Cheers for the help,
Benjimang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #693 (permalink)  
Old 08-02-2007, 02:11 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Question How do I post profit of currency at top right of graph??

I would like to post the profit/loss of currency at top right of the trade platform currency graph (EURUSD). If the profit of the current trade is positive, it would show in green; If it be 0.00, it would show in white; If it is a loss, it would show in red.

I know ObjectCreate is the way to go, but beyond that I do not know how to capture the profit from the tradeplatform? Can someone give me a hand on this utility?? I want to include this in my ea.

Thanks!

Dave
<><<<

Last edited by iscuba11; 08-02-2007 at 04:35 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #694 (permalink)  
Old 08-02-2007, 03:17 AM
FX4$$$'s Avatar
Junior Member
 
Join Date: Apr 2006
Posts: 16
FX4$$$ is on a distinguished road
Profit/Loss of currency

Dave,
I think you need to be more specific in what you are asking for. And BTW why don't to reply to PMs? Where are you hiding these days??? lol

P in KC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #695 (permalink)  
Old 08-02-2007, 04:32 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile

Quote:
Originally Posted by FX4$$$ View Post
Dave,
I think you need to be more specific in what you are asking for. And BTW why don't to reply to PMs? Where are you hiding these days??? lol

P in KC
I have not received any new PM's???? Unfortunately during this time I had a family emergency that happened - All is well with the emergency. I still could use the help on my coding, especially the envelope coding.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #696 (permalink)  
Old 08-02-2007, 04:52 AM
Member
 
Join Date: Feb 2006
Posts: 35
flexie is on a distinguished road
trading stats

use this code:

// ************************************************** *************************
int stats()
{
int i, vOrders;

// current CP profit
vOrders = OrdersTotal();
Profit = 0;
PipsProfit = 0;
for(i=vOrders-1;i>=0;i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol() == Symbol())
{
Profit += OrderProfit();
if (OrderType() == OP_BUY) PipsProfit += ((Bid - OrderOpenPrice())/Point);
else if (OrderType() == OP_SELL) PipsProfit += ((OrderOpenPrice() - Ask)/Point);
}
}
}
// potential risk
// max positions
}

Profit & PipsProfit will need to be declared outside the program, then display then on the screen with your favorite method. Comments if nothing else.

Mark
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #697 (permalink)  
Old 08-02-2007, 05:28 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile

Thanks, I think I can take it from here with your coding. As they say in the South, Moucho Gracias!

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #698 (permalink)  
Old 08-02-2007, 08:36 AM
Junior Member
 
Join Date: Jun 2007
Posts: 5
fxbeginner is on a distinguished road
Codersguru please help me!

Hello. Perhaps you can help me.
I try to code EA with Ichimoku a Kinko Hyo.
It is to set a Buy order, if the Tenkan - sen is over the Kijun - sen.
If Tenkan<Kijun then Sell order. And whole at 20.00 o'clock.
Please help me.
Thank you.
fxbeginner
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #699 (permalink)  
Old 08-02-2007, 08:45 AM
european's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 284
european is on a distinguished road
entry on a new bar

I am coding an option of OrderSend on the start of the next bar.

Anybody can direct/post good code on how to enter trade on a new bar?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #700 (permalink)  
Old 08-02-2007, 10:08 AM
luckyfx's Avatar
Junior Member
 
Join Date: Feb 2006
Posts: 2
luckyfx is on a distinguished road
not trade on Monday

Hello!

Could someone post simple code which disable Expert on Monday and start trading week only of the beginning of Tuesday?

Thanks!
luckyfx
__________________
Lux ex tenebris!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, ZUP_v1.mq4

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/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


All times are GMT. The time now is 04:55 AM.



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