Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent 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
  #481 (permalink)  
Old 11-11-2007, 12:49 PM
Junior Member
 
Join Date: Dec 2006
Posts: 2
arasharaz is on a distinguished road
csv files

dear friends
i need an indicator to save me the CSV files instead of using "ctrl+s"
thanks
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
  #482 (permalink)  
Old 11-13-2007, 02:54 PM
Junior Member
 
Join Date: Apr 2006
Posts: 2
c14n6 is on a distinguished road
need coding: when GAP occurs..

Hello everyone,

Could someone give me the code to prevent EA opening new trades when there is a gap on 1H chart? cause i want to run this ea 24 hours. Please help me ... my EA almost finish. thank you

Last edited by c14n6; 11-13-2007 at 03:01 PM. Reason: edit
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
  #483 (permalink)  
Old 11-13-2007, 09:26 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by c14n6 View Post
Hello everyone,

Could someone give me the code to prevent EA opening new trades when there is a gap on 1H chart? cause i want to run this ea 24 hours. Please help me ... my EA almost finish. thank you
A gap means an absence of ticks, and that means the EA is not invoked during the gap. So, what do you mean? Do you mean to not trade during the first hour following a gap? Or maybe avoid the first tick following a gap, or more generally classify "this" hour as "slow" if there's "long time" between ticks?
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
  #484 (permalink)  
Old 11-19-2007, 02:41 PM
el cid's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 967
el cid is an unknown quantity at this point
Talking

Quote:
Originally Posted by BaasHarm View Post
Hi guys,

I've been following this forum for a while now and picked up a lot of valuable lessons already. Especially thanks to Coder Guru for the quickstart to MQL4.

I'm managed to build a few simple EA's just to get familar with MT4. Now I want to start a new project but I got stuck.

I want to enter a trade after a 10 pip move, not based on any indicator, just on the tick data, if price moves up 10 pips (eventually with a time limit), I want to enter long and and if it moves down, go short. I don't want to use the bar open or close as this may be late or miss some big moves. What I need is how to "freeze" the starting price to compare to the bid/ask to see when the condition is met.

Any suggestions?
Baas Harm

It is nice to see you learn how to code .There are some great coders here who can show you how to code and help you.

Regards

El cid
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
  #485 (permalink)  
Old 11-19-2007, 05:01 PM
Member
 
Join Date: Oct 2005
Posts: 35
yaniv_av is on a distinguished road
How to check the last position bar index

Hi,

I want to open a new trade only if there is no position that was opened (and is still opened) in the last 5 bars.
How can I do that?

Thanks!
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
  #486 (permalink)  
Old 11-23-2007, 11:13 AM
AQUILEZ's Avatar
Member
 
Join Date: Jul 2006
Posts: 64
AQUILEZ is on a distinguished road
Multiple Trades

How to open multiple trades on the same EA & same pair
how the EA can treat a open position independent from each other in the same pair?
Example if we use a moving average Like principal indicator for enter the market but at the time wen enter the market goes again us and moving average triger a different signal how to open a new position with out closing the previous trade regardless if loss or not.
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
  #487 (permalink)  
Old 11-23-2007, 12:41 PM
AQUILEZ's Avatar
Member
 
Join Date: Jul 2006
Posts: 64
AQUILEZ is on a distinguished road
Problem Statement

start() Disadvantage of a looped Expert Advisor is the impossibility to open the setup panel. Try to loop an EA - and you won't be able to set it up.
The same idea can be successfully realized using a script. This means an infinite loop can be organized in a script. But there are no parameters to be set up in scripts.

MagicNumber
extern int Expert_ID = 1234;
int _MagicNumber = 0;

int init()
{
int Period_ID = 0;
switch ( Period() )
{
case PERIOD_MN1: Period_ID = 9; break;
case PERIOD_W1: Period_ID = 8; break;
case PERIOD_D1: Period_ID = 7; break;
case PERIOD_H4: Period_ID = 6; break;
case PERIOD_H1: Period_ID = 5; break;
case PERIOD_M30: Period_ID = 4; break;
case PERIOD_M15: Period_ID = 3; break;
case PERIOD_M5: Period_ID = 2; break;
case PERIOD_M1: Period_ID = 1; break;
}
_MagicNumber = Expert_ID * 10 + Period_ID;

But how about in the same time frame??????
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
  #488 (permalink)  
Old 11-23-2007, 01:14 PM
Junior Member
 
Join Date: Nov 2007
Posts: 13
miquest is on a distinguished road
Help code this Great EA

It's Great and it's good, need help coding this EA sumtin like this, can anyone please help me, would really appreciate it please......

Indicators

Gann_hilo_activator 4HR-------for confirmation of overall trend

Gann_hilo_activator 1HR-------for signal

5 simple moving averages (SMA)—for determining the point of entry

Entry signals

Buy signal (1)

If the price opens above the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then buy if the value of 5 SMA is greater than or equal (≥) to the price.


Buy signal (2)

If the Buy signal (1) condition still holds and the price retraces by a predetermined number of pips then buy another lot e.g. for EUR/USD =32pips.

Sell signal (1)

If the price opens below the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then sell if the value of 5 SMA is less than or equal (≤) to the price.

Sell signal (2)

If the Sell signal (1) condition still holds and the price retraces by a predetermined number of pips then sell another lot e.g. for USD/CAD=46pips.


Exit signals

Close Buy signals

If the price opens below the Gann_hilo_activator 1HR

Close sell signals

If the price opens above the Gann_hilo_activator 1HR

External parameters

By default

--------------------------

Trailing stops =

Stop loss =

Take profit =

extern double Lots = 0.01; // I trade a microlots using a mini account

extern int Slippage = 3;

extern bool StopLossMode = True;

extern int StopLoss = 17; //

extern bool TakeProfitMode = false;

extern int TakeProfit = 60;

extern bool TrailingStopMode = True;

extern int TrailingStop = 37;

Money management code not risking more than 1.2% on one pair of currency at a time and maximum amount of capital at risk is 10%

Gann_hilo_activator 4HR-------for confirmation of overall trend


Gann_hilo_activator 1HR-------for signal

5 simple moving averages (SMA)—for determining the point of entry

my_EA_@_my_own_risk

Hello sir, this is my system that I use and will like to turn in into an EA

Indicators

Gann_hilo_activator 4HR-------for confirmation of overall trend

Gann_hilo_activator 1HR-------for signal

5 simple moving averages (SMA)—for determining the point of entry

Entry signals

Buy signal (1)

If the price opens above the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then buy if the value of 5 SMA is greater than or equal (≥) to the price.


Buy signal (2)

If the Buy signal (1) condition still holds and the price retraces by a predetermined number of pips then buy another lot e.g. for EUR/USD =32pips.

Sell signal (1)

If the price opens below the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then sell if the value of 5 SMA is less than or equal (≤) to the price.

Sell signal (2)

If the Sell signal (1) condition still holds and the price retraces by a predetermined number of pips then sell another lot e.g. for USD/CAD=46pips.


Exit signals

Close Buy signals

If the price opens below the Gann_hilo_activator 1HR

Close sell signals

If the price opens above the Gann_hilo_activator 1HR

External parameters

By default

--------------------------

Trailing stops = 17

Stop loss = 37

Take profit = false

extern double Lots = 0.01; // I trade a microlots using a mini account

extern int Slippage = 3;

extern bool StopLossMode = True;

extern int StopLoss = 17; //

extern bool TakeProfitMode = false;

extern int TakeProfit = 60;

extern bool TrailingStopMode = True;

extern int TrailingStop = 37;

Money management code not risking more than 1.2% on one pair of currency at a time and maximum amount of capital at risk is 10%
Attached Files
File Type: doc mt ea.doc (73.0 KB, 22 views)
File Type: mq4 ###Gann_HiLo_Activator_v2###.mq4 (3.2 KB, 43 views)

Last edited by miquest; 11-23-2007 at 04:09 PM. Reason: correct sumtin
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
  #489 (permalink)  
Old 11-23-2007, 07:45 PM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 820
wolfe is on a distinguished road
Quote:
Originally Posted by AQUILEZ View Post
How to open multiple trades on the same EA & same pair
how the EA can treat a open position independent from each other in the same pair?
Example if we use a moving average Like principal indicator for enter the market but at the time wen enter the market goes again us and moving average triger a different signal how to open a new position with out closing the previous trade regardless if loss or not.
Assign every order a unique ticket number and separate magic number. Only close orders by magic number.

You could then use Orderselect() to get the info of that specific ticket, when your criteria is met, close your order by magic number.

Hope this helps.
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
  #490 (permalink)  
Old 11-23-2007, 09:55 PM
Julia's Avatar
Junior Member
 
Join Date: Aug 2007
Posts: 17
Julia is on a distinguished road
Time code help????????????

Can someone be so kind and tell me how to code the following code?:

If my Ea is turned on the M30 chart, I want the code to say:

if(on the M5 timeframe, today's close is>yesterday's close)
{
.........
}
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 03:44 AM.



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