Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1541 (permalink)  
Old 01-18-2009, 01:22 AM
Junior Member
 
Join Date: Nov 2008
Posts: 15
qqjl868 is on a distinguished road
Thumbs down

Quote:
Originally Posted by codersguru View Post
jdun,

The code of SL & TP has already written in this EA:
Look at these lines:

PHP Code:
if (Symbol()=="GBPUSD") {
      
PipsForEntry13;
      
TrailingStop 40;
      
TakeProfit 45
      
InitialStopLoss=33;
    } else    if (
Symbol()=="EURUSD") {
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=23;
    } else    if (
Symbol()=="USDCHF") {
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=15;
    } else {      
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=30;
    } 
If you want to make SL & TP external variables which you can set, you have to comment the above lines of code and uncomment these lines:

PHP Code:
/*
extern int PipsForEntry= 5;
extern double TrailingStop = 40;
extern double TakeProfit = 120;
extern double InitialStopLoss=50;
*/ 
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
  #1542 (permalink)  
Old 01-18-2009, 03:03 AM
Junior Member
 
Join Date: Nov 2007
Posts: 16
msquared is on a distinguished road
max trades per signals

Does anybody know what i would use to limit the number of trades per signal ( i would like 1 trade per signal but am getting like 8 and the last one always is a loser)
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
  #1543 (permalink)  
Old 01-18-2009, 07:41 AM
Junior Member
 
Join Date: May 2008
Posts: 2
hkstar98 is on a distinguished road
Help

Hai,

There is still have a stop loss


Quote:
Originally Posted by pghiaci View Post
Hi
here you go
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
  #1544 (permalink)  
Old 01-18-2009, 08:18 PM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 516
Beno is on a distinguished road
Srp ea

Here an EA idea that looks good but i'm sure there's a mistake in the code some where.

SRP= Support, Resistance, Pivot.

entry

using the S & R based on the previous bar and a different TF.
currently the signals are from the 30min TF I have started testing on the 4hr

Anyway if you want to have a look at the EA it's attached.

I think a percentage based exit would work well. one for both buy and sell.

Cheers

Beno
Attached Files
File Type: mq4 SRP.mq4 (2.7 KB, 36 views)

Last edited by Beno; 01-23-2009 at 07:48 PM.
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
  #1545 (permalink)  
Old 01-20-2009, 08:55 PM
Junior Member
 
Join Date: Jan 2009
Posts: 7
garhardt is on a distinguished road
EA w/ multiple CUSTOM times ?

I realize an EA can be made w/ multiple time frames, BUT can one be written w/ custom times ? I have an EA w/ MTF but I need custom times not default times so they don't "line up" that often.

regards
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
  #1546 (permalink)  
Old 01-21-2009, 06:34 PM
Junior Member
 
Join Date: Nov 2007
Posts: 15
nuozek is on a distinguished road
Hi guys

How to end a order at the CLOSE of the current bar?

I tried:

if (Close[i] < Open[i])

but it did not work.
i'm totaly rookie in mql.
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
  #1547 (permalink)  
Old 01-21-2009, 10:51 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
Quote:
Originally Posted by nuozek View Post
Hi guys

How to end a order at the CLOSE of the current bar?

I tried:

if (Close[i] < Open[i])

but it did not work.
i'm totaly rookie in mql.
There is no way to know the last tick of a bar before the next bar opens. The "Close[0]" is always the last know bid, and a new bar starts at the first tick following the timeframe grid.
The first tick of a bar is easier to catch, you can use:
1) Volume[0] == 1
2) Bars() > PreviousBars
3) Time[0] > PreviousTime
The last one is the most reliable and the only one to be used on real account.
I said "most" because it may happen to be also wrong, for example in the case of deconnection. When the connection is retablished you might have lose 5 bars, then the first received bar is the current one, NOT the first missed one. The missed ones are coming after. So the times of the received bars are no more sorted ! Tkx MQ for this very intelligent behavior .
PS : But its also true that the missed bars are not tradables.

Last edited by Michel; 01-21-2009 at 10:56 PM. Reason: addendum
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
  #1548 (permalink)  
Old 01-22-2009, 01:22 PM
Junior Member
 
Join Date: Jan 2009
Posts: 1
metaexpert123 is on a distinguished road
Probleme My EA

Hi,


I have a problem with my EA. and I know nothing in MQ4. if anyone can help me I can explain my problem

THX
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
  #1549 (permalink)  
Old 01-23-2009, 07:24 PM
Junior Member
 
Join Date: Jan 2009
Posts: 2
southtrader is on a distinguished road
pop up box (how to)

Hi there!!

I'm new to coding and as long as I did some code change in the past I never get to acctually write something from scratch before.

Basically I would like to know how to make a pop up box appear on my chart when I right click with my mouse in a candle.

If somebody knows about a template or some plug already there that does it, I'm pretty sure I can take a look at the code and learn from it
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
  #1550 (permalink)  
Old 01-25-2009, 07:00 PM
Junior Member
 
Join Date: Jan 2009
Posts: 2
MetaMaster is on a distinguished road
How to create finite line object

It is possible to create trendline_object which is infinite. But how can I draw line from one point to another?
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
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 12:54 AM.



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