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
  #591 (permalink)  
Old 05-14-2007, 12:49 PM
carllos's Avatar
Member
 
Join Date: May 2006
Location: Portugal
Posts: 54
carllos is on a distinguished road
Talking dummiest question

This one must be easy, i just can´t figure out. Maybe i´m too tired.

How can i close a trade after 5 bars from opening bar?

Thanks
__________________
"Hoe ur pips mate?"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #592 (permalink)  
Old 05-14-2007, 02:10 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,815
Blog Entries: 145
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by phoenix
Pls anyone know how to define higher high, higher low, lower high and lower low please reply


thank you.
It is hre Highest high for an indicator
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #593 (permalink)  
Old 05-14-2007, 03:01 PM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Look post #516 for solution without arrays, as far as I can tell everybody uses array version for indicators. and use search button
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #594 (permalink)  
Old 05-15-2007, 02:54 AM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 289
phoenix is on a distinguished road
Quote:
Originally Posted by newdigital

thanks i'll have it a try
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #595 (permalink)  
Old 05-18-2007, 01:00 AM
ryanklefas's Avatar
Senior Member
 
Join Date: Apr 2006
Location: USA
Posts: 439
ryanklefas is on a distinguished road
Here's a good one for ya!

Hi CodersGuru (you da man!),

This one has me stumped. The MetaEditor has an option for toggling breakpoints. When I try to compile EAs though, the breakpoints are ignored. What are they in there for? Does MetaEditor have breakpoints, and if so, how do I use them?

Thanks,
Ryan


PS: I don't know if I said this already, but YOU DA MAN!!
__________________
"Don't work harder, work smarter." -- my Java professor

Coder for Hire:
http://www.firecell-fx.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #596 (permalink)  
Old 05-21-2007, 06:01 AM
Junior Member
 
Join Date: Feb 2007
Posts: 9
pawang is on a distinguished road
can open buy and sell stick together?

Can open buy and sell stick together?
Imagine after an open buy signal on hourly ea execute an open buy with specific target profit and stop order. but before it's order done, next signal from 4 hours chart is sell. so ea execute a new sell without close the last buy position that appeard from hourly signal.
The open position both buy and sell will be liquidated with a specific take profit and stop loss.
Other example, when we have a daily candle as a buy signal, so EA will execute an opening tick after the last daily candle. But it maybe not a very best price to buy at that opening price, so when hourly signal is sell and when it's liquidated lower than the price we open buy, it means that we get the better price on buying.
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #597 (permalink)  
Old 05-25-2007, 10:32 AM
Junior Member
 
Join Date: Feb 2007
Posts: 9
pawang is on a distinguished road
Limit/Stop until NY close

My next question:
How to manage limit/stop until a specific time?
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #598 (permalink)  
Old 05-28-2007, 12:47 PM
Senior Member
 
Join Date: Aug 2006
Posts: 128
ruparaw is on a distinguished road
Yesterday High/Low EA

Hi,

Can somebody help me to create a simple ea to purchase a buy order if todays price touching yesterday high(1 day candle) and to purchased Sell order if todays price touching yesterday low(1 day candle). I want to set a 5 pips tp.


Thanks in advance for your kind help

Last edited by ruparaw; 05-28-2007 at 12:49 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #599 (permalink)  
Old 05-30-2007, 12:43 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Question Script for adding Trailing Stop to position

I need an experts advice on how to finish or write properly a Script for adding a trailing stop to a new position. Would you be so kind and figure out what I am doing wrong. I tried to use the guts of an EA to create this script. It seems I lack something in the translation from EA to a Script - Please Help!

Much thanks in advance!!!

Dave




PHP Code:
//+------------------------------------------------------------------+
//|                                         Script Trailing Stop.mq4 |
//|                                                                  |
//|                                                                  |
//|                                                        |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"
#include <stdlib.mqh>
#include <WinUser32.mqh>

//+------------------------------------------------------------------+
//| script "Create Trailing Stop On Open Position"     |
//+------------------------------------------------------------------+

int start()
  {
//----
   
if(MessageBox("Do you really want to use a [7 PIP] TRAILING STOP on "+Symbol() ,
                 
"Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1);
//----


bool   ProfitTrailing True;  // 
int    TrailingStop   7;     // 
int    TrailingStep   1;     // 
//bool   UseSound       = True;  // 
string NameFileSound  "expert.wav";  // 

//+------------------------------------------------------------------+
//| Script "Trailing Stop start function                             |
//+------------------------------------------------------------------+
 
{
  for (
int i=0i<OrdersTotal(); i++) {
    if (
OrderSelect(iSELECT_BY_POSMODE_TRADES)) {
      
TrailingPositions();
    }
  }
}

TrailingPositions() {
  
double pBidpAskpp;

  
pp MarketInfo(OrderSymbol(), MODE_POINT);
  if (
OrderType()==OP_BUY) {
    
pBid MarketInfo(OrderSymbol(), MODE_BID);
    if (!
ProfitTrailing || (pBid-OrderOpenPrice())>TrailingStop*pp) {
      if (
OrderStopLoss()<pBid-(TrailingStop+TrailingStep-1)*pp) {
        
ModifyStopLoss(pBid-TrailingStop*pp);
        return;
      }
    }
  }
  if (
OrderType()==OP_SELL) {
    
pAsk MarketInfo(OrderSymbol(), MODE_ASK);
    if (!
ProfitTrailing || OrderOpenPrice()-pAsk>TrailingStop*pp) {
      if (
OrderStopLoss()>pAsk+(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0) {
        
ModifyStopLoss(pAsk+TrailingStop*pp);
        return;
      }
    }
  }
}

 

void ModifyStopLoss(double ldStopLoss) {

  
bool fm;

  
fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE);
 
}

//+------------------------------------------------------------------+ 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #600 (permalink)  
Old 05-31-2007, 09:26 PM
ryanklefas's Avatar
Senior Member
 
Join Date: Apr 2006
Location: USA
Posts: 439
ryanklefas is on a distinguished road
Quote:
Originally Posted by iscuba11
I need an experts advice on how to finish or write properly a Script for adding a trailing stop to a new position. Would you be so kind and figure out what I am doing wrong. I tried to use the guts of an EA to create this script. It seems I lack something in the translation from EA to a Script - Please Help!

Much thanks in advance!!!

Dave


For one thing, "TrailingPositions" is a function yet you haven't specified the return type; putting "void" as the return type should work.
__________________
"Don't work harder, work smarter." -- my Java professor

Coder for Hire:
http://www.firecell-fx.com
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 03:36 AM.



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