Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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
  #1 (permalink)  
Old 08-27-2006, 05:55 AM
Junior Member
 
Join Date: Aug 2006
Posts: 3
pabloschiki is on a distinguished road
Trouble with bars

Hi everyone,

My very small EA is not counting the bars properly..... I thought that if I'm in a 5' chart window, it would do it, but it does not.
So because I'm new at this, I'm trying with something very small, just delivering buy stops and sell stops at 20 pips from the last bar high and low.
It does compiles fine, however the EA is sending many orders per bar, not just 1 and 1.
What is the problem with it?

PHP Code:
//+------------------------------------------------------------------+
//|                                                    First try.mq4 |
//|                                                            Pablo |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Pablo"
#property link      ""

//---- input parameters

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
  
   
int    TicketPendingOrderLongTicketPendingOrderShort;
   
double point;
   
point=MarketInfo(Symbol(),MODE_POINT);

 
 
     {
      
TicketPendingOrderLong=OrderSend(Symbol(),OP_BUYSTOP,1.0,High[1]+20*Point,5,High[1]-10*Point,High[1]+50*Point,"Long pending order",16384,0,Green);
      if(
TicketPendingOrderLong<=0) Print("Error = ",GetLastError());
      
TicketPendingOrderShort=OrderSend(Symbol(),OP_SELLSTOP,1.0,Low[1]-20*Point,5,Low[1]+10*Point,Low[1]-50*Point,"Short pending order",16384,0,Green);
      if(
TicketPendingOrderShort<=0) Print("Error = ",GetLastError());
      return(
0);
      }
 
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+ 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-28-2006, 12:17 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
you did not block the max trade at a time and

did not code any thing related to the bar (except high and low)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-28-2006, 10:58 PM
Junior Member
 
Join Date: Aug 2006
Posts: 3
pabloschiki is on a distinguished road
Max trades at a time?

ohhh I see, I just finished an indicator that reads the bars, in this case the last one, so I'm going to attach it to my window and modify the EA to take data from it.
However you've mention something about limiting the trades by time??????? what is that????? I'm very thankful for your help, I'm new at this.

Pablo.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-29-2006, 12:49 PM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 287
phoenix is on a distinguished road
ie.
PHP Code:
if(OrdersTotal()<1)
{
  
OrderSend(..........);

this will allow only 1 order at a time
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-29-2006, 08:09 PM
Junior Member
 
Join Date: Aug 2006
Posts: 3
pabloschiki is on a distinguished road
thanks

thanks a lot phoenix, have a nice day
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
anyone having trouble with marketiva increase General Discussion 2 02-09-2007 03:08 AM
Having trouble finding Broker matrixebiz Metatrader 4 1 12-11-2006 12:06 PM
Trouble Shooting Mr.Marketz Metatrader 4 mql 4 - Development course 5 11-07-2006 08:48 PM
having trouble with multiple EAs ycomp Expert Advisors - Metatrader 4 6 03-03-2006 04:41 AM


All times are GMT. The time now is 11:57 PM.



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