Forex



Go Back   Forex Trading > Training > Metatrader > 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
 
Thread Tools Display Modes
  #1431 (permalink)  
Old 12-25-2008, 08:54 PM
Member
 
Join Date: Aug 2007
Posts: 30
falanca is on a distinguished road
Friends ı have an EA with support resistance indicator.EA must complete orders on target profit.But it lacks sometime.How can ı get rid of this problem.Please help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1432 (permalink)  
Old 12-27-2008, 09:25 AM
Senior Member
 
Join Date: Apr 2008
Location: Rawalpindi
Posts: 106
arshadFX is on a distinguished road
how to get OrderClose return price ?

I want to know, at what price the order is closed ......
Attached Images
File Type: jpg closeorder.JPG (61.7 KB, 220 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1433 (permalink)  
Old 12-29-2008, 05:48 AM
Junior Member
 
Join Date: Aug 2008
Posts: 1
Didatsd is on a distinguished road
About take profit & stop loss

I am sorry for my english.

In Coders' Guru - First Expert Advisor - we get "TakeProfit = 250".
I thing TakeProfit is the maximum profit that we can take,
but when backtest in 4H tf we got profit 980, 855, etc.
And when I try to add stop loss "TakeStop = 350"

OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+TakeStop *Points,Bid- TakeProfit*Points, "macd sample",16384,0,Red);

It still I got stop for -950, -1420, etc.

Can anyone explain me why ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1434 (permalink)  
Old 12-30-2008, 12:35 PM
Junior Member
 
Join Date: Dec 2008
Posts: 17
malaz is on a distinguished road
Hi all,

I'm sorry. I mean to search but my keyword is too short. I just want to know if there is any way I can get the code for *.ex4 files? (keyword for my search: ex4)

I would like to do a simple editing to my preference but I only have the *.ex4 file.

Any help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1435 (permalink)  
Old 01-02-2009, 12:40 PM
numbercruncher's Avatar
Junior Member
 
Join Date: Jan 2007
Posts: 11
numbercruncher is on a distinguished road
Question First quote of a new candle?

I'm sure this must have been asked before - apologies if so, but I can't find it discussed anywhere.

As I understand it "When new quotations are received, the "start()" function of attached expert advisors and custom indicator programs is executed."
I want to do some checks at the first quote of a new 5 min candle. Is there an elegant way to check that this is the first quote of a new candle?

thanks in advance for any ideas.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1436 (permalink)  
Old 01-05-2009, 12:16 AM
numbercruncher's Avatar
Junior Member
 
Join Date: Jan 2007
Posts: 11
numbercruncher is on a distinguished road
No one interested?

Just in case somebody's listening ...
How about this ? Does it make sense for 5min timscale?

Code:
int              Minute5;              //global to hold 5 minute number

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
void init()
{
   Minute5 = TimeMinute(TimeCurrent()) / 5;
}
//+------------------------------------------------------------------+   
int start()
{
      if (ManageOpenOrders() > 0)
      {
         return(0);
      }
      else
      {
         if ( (TimeMinute(TimeCurrent()) / 5) != Minute5 )
         {
            Minute5 = TimeMinute(TimeCurrent()) / 5;     //reload variable at first tick of every candle
            // check trade criterion ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1437 (permalink)  
Old 01-07-2009, 07:21 PM
Junior Member
 
Join Date: Jan 2006
Posts: 8
pipmonger is on a distinguished road
iStochastic help needed -Slowing field variable issue...

Hi:

I am having problem with iStochastic.

It returns ZERO value when the MODE_SIGNAL (value of 1) - is used
with SLOWING as a variable.

extern int stoch1k = 14 ;
extern int stoch1s = 3 ;
extern int stoch1d = 3 ;

double stoch1s = iStochastic (NULL,0, stoch1k,stoch1d,stoch1s, 0,0,1,0) ;
always return a ZERO value and not the real position of signal line when
variable is used in SLOWING filed (stoch1s).

But when I HARDCODE that parameter, instead of variable stocha1s (Slowing)
I put number 3 in the same statement it works fine like below :

double stoch1s = iStochastic (NULL,0, stoch1k,stoch1d,3, 0,0,1,0) ;

Can anyone guide me on this please.
I would like to use variable fields for diff values.

Thanks in advance

Pipmonger
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1438 (permalink)  
Old 01-07-2009, 07:58 PM
Junior Member
 
Join Date: Oct 2006
Posts: 26
bobfourie is on a distinguished road
NewBar

Quote:
Originally Posted by numbercruncher View Post
Just in case somebody's listening ...
How about this ? Does it make sense for 5min timscale?
Hi numbercruncher, I use this function that I wrote .You can use any of the timeframes to determine if its an new bar in that timeframe

Code:
int start()
{
  if(ISNewBar(5))
  {
    //do some thing
  }

}

bool ISNewBar(int iTimeFrame)
{
int iIndex = -1;

   switch(iTimeFrame)
   {
    case 1    : iIndex = 0; break;
    case 5    : iIndex = 1; break;
    case 15   : iIndex = 2; break;
    case 30   : iIndex = 3; break;
    case 60   : iIndex = 4; break;
    case 240  : iIndex = 5; break;
    case 1440 : iIndex = 6; break;
    default   : iIndex =-1; break;
   }
 static int LastBar[7]= {0,0,0,0,0,0,0}; 
 datetime curbar = iTime(Symbol() ,iTimeFrame, 0);
 if(LastBar[iIndex]!=curbar)
  {
    LastBar[iIndex]=curbar;
    return (true);
  }
  else return(false);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1439 (permalink)  
Old 01-09-2009, 11:46 PM
numbercruncher's Avatar
Junior Member
 
Join Date: Jan 2007
Posts: 11
numbercruncher is on a distinguished road
Quote:
Originally Posted by bobfourie View Post
Hi numbercruncher, I use this function that I wrote .You can use any of the timeframes to determine if its an new bar in that timeframe


Thanks bobfourie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1440 (permalink)  
Old 01-13-2009, 11:59 PM
Junior Member
 
Join Date: Aug 2008
Posts: 2
danielprasetyo is on a distinguished road
How to modify alert code so it alerts as it happens

Hi guys,
I'm newbie to coding. I have this OSMA indicator, it already has built in zero cross alert but unfortunately it only alerts at the beginning of next candle. Please show me how to modify the alert code so it will alert as it happens. And please show me how to add arrow alert.
Thanks.
Attached Files
File Type: mq4 OsMA_ColorHist_Alert.mq4 (6.4 KB, 15 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, 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


All times are GMT. The time now is 07:30 PM.



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