Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
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
  #1331 (permalink)  
Old 10-04-2008, 10:17 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
:: then I'm afraid it's all about the way you do your loop function... like you have to refresh it all the time a new transaction is made

IN10TION
Quote:
Originally Posted by Dakhr View Post
Refill (update )them after k transactions from last use
__________________
NEW UPDate! 04 Nov. 09 IN10TION newsReader v09.98 Lite - the best forex news reader on your chart
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
  #1332 (permalink)  
Old 10-04-2008, 10:32 AM
Junior Member
 
Join Date: May 2006
Posts: 6
Dakhr is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
:: then I'm afraid it's all about the way you do your loop function... like you have to refresh it all the time a new transaction is made

IN10TION
Thanks man
Things seems little bit clear
Let me think :
Example:after first call(buy/sell) i fill array:

1,2,3
4,5,6
7,8,9

Let say new transactions appeared in history: 1',2',3' I want new array look like this :
1',2',3'
1,2,3
4,5,6
Should I count how many times procedure was call after each buy/sell When i reach required calls i update array .I'm right?
But after restarting terminal i lose this information.Should i write this to file??
Thanks again
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
  #1333 (permalink)  
Old 10-04-2008, 10:49 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
:: you can make it complex as you want ... but the only thing that stays the same is that you have to be able to refresh/refill your array with the open orders (easily to get) &/or go into history listing (easy to get to), to refill the previous data... don't use a file if all data is already easily available in metatrader... if there is specific info/data you want to keep, then yes, but figure things out first if you really need that...

:: if you only want to add something to the array without going in a loop of everything, then yes, you have to remember the last position, to fill in the next... otherwise you will delete the previous... if you do this, then the procedure of the code will be much faster... nevertheless you need the restore procedure to.
Quote:
Originally Posted by Dakhr View Post
Thanks man
Things seems little bit clear
Let me think :
Example:after first call(buy/sell) i fill array:

1,2,3
4,5,6
7,8,9

Let say new transactions appeared in history: 1',2',3' I want new array look like this :
1',2',3'
1,2,3
4,5,6
Should I count how many times procedure was call after each buy/sell When i reach required calls i update array .I'm right?
But after restarting terminal i lose this information.Should i write this to file??
Thanks again
__________________
NEW UPDate! 04 Nov. 09 IN10TION newsReader v09.98 Lite - the best forex news reader on your chart

Last edited by IN10TION; 10-04-2008 at 10:52 AM.
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
  #1334 (permalink)  
Old 10-04-2008, 09:11 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
Quote:
Originally Posted by Dakhr View Post
Thanks man
Things seems little bit clear
Let me think :
Example:after first call(buy/sell) i fill array:

1,2,3
4,5,6
7,8,9

Let say new transactions appeared in history: 1',2',3' I want new array look like this :
1',2',3'
1,2,3
4,5,6
Should I count how many times procedure was call after each buy/sell When i reach required calls i update array .I'm right?
But after restarting terminal i lose this information.Should i write this to file??
Thanks again
Maybe I don't understand your question, but it seems to me useless to write a file with information easy to retrieve from the server (I mean the history of your trades)
What seems easy is to loop thru the history every tick (it's fast) or every new M1 bar, or when you want, and keep the count of the orders matching a specified MagicNumber. In the same loop, you store the CloseTime of each trade in the first of a two dimentional array, and for example the Ticket in the second one. Then, if your count was incremented by tree, update your static counter (+=3) and sort the array by the first dimension in descending order. From that sorted array, you can build easily the second array like you want.
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
  #1335 (permalink)  
Old 10-05-2008, 04:43 AM
Member
 
Join Date: Jul 2008
Posts: 42
yast77 is on a distinguished road
Smile Get Time input from a file

Hi all, i want to ask how to write the coding that can get day, hours and minute from a file ? i know it need arrays inside our coding, but im poor in writing arrays. The concept is like Multiple10pointsX2 ea, we able to input the news time weekly into the file, then the ea will read from the file that the news time happen, so the ea will stop trading at that moment. Thanks for 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
  #1336 (permalink)  
Old 10-06-2008, 03:44 AM
bakhul's Avatar
Junior Member
 
Join Date: Jun 2008
Posts: 20
bakhul is on a distinguished road
Need help...

Could u someone here help me to add alert to this filter,when it cross 0 level or change color.

Thank`s for u who want to help me...
Attached Files
File Type: mq4 Forex Trend fxfariz.mq4 (2.6 KB, 13 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
  #1337 (permalink)  
Old 10-06-2008, 03:46 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,410
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
Quote:
Originally Posted by bakhul View Post
Could u someone here help me to add alert to this filter,when it cross 0 level or change color.

Thank`s for u who want to help me...
Maybe you would have better luck to posting here: Indicators with alert/signal
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
  #1338 (permalink)  
Old 10-06-2008, 07:30 PM
cutzpr's Avatar
Member
 
Join Date: Jan 2008
Posts: 60
cutzpr is on a distinguished road
How Many Currently open Buy, and Sell Orders from EA

I just went through 134 pages hoping someone had already answer this question. But I was out of luck..

After creating and tweaking every type of cross over, and pivot point, and ATR range, and break out strategy that I can conceive with the hundreds of different indicators that I have. I realized that a full blown automated EA needs tons of variables that you need to code for. So I instead, I am starting to create user assisted expert advisors. Well to the questions at hand...

What code can be used to count how many open Buy and how many open sell orders the EA currently has open in the Market.
I do not want it to count how many open orders there are in total because I will be placing orders as well on the same account to offset the current orders that the EA has placed.

Eventually I would like to set up filters that will alter the ratio of buy and sell orders for hedging purposes.
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
  #1339 (permalink)  
Old 10-06-2008, 09:52 PM
Senior Member
 
Join Date: Aug 2008
Location: London
Posts: 138
Limstylz is on a distinguished road
A little help please...

Hi All,

I originally posted this as a new thread, but it was moved into another programming thread (I have no objections to its move BTW) and now seems to have got lost due to the amount of posters in that thread.

Perhaps someone here can help me?

I have nearly finished my first EA after nearly 7 days of trial and error and cutting and pasting and hours of research....

Can someone please tell me how to issue an exit or stop function to an EA?

I want the EA to delete all current and pending trades and exit after reaching 10,000 in equity. Below is that portion of the code so far:

PHP Code:
bool StopTrade;
       
int total OrdersTotal(), cnt 0ExitAtEquity=10000;
 
   for (
cnt total cnt >=cnt-- )
      {
         
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
            if (
AccountEquity ()== ExitAtEquity)//(TimeCurrent()- OrderOpenTime() >= ActiveMinutes*60 )
               
{if(OrderType()==OP_BUY)
                  
OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
                     if(
OrderType()==OP_SELL
                        
OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
                           if(
OrderType()>OP_SELL)
                              
OrderDelete(OrderTicket());
                                 
StopTrade=true;}
                                 } 
 
      if (
dclose==dopen && OrdersTotal() < ConcurrentTrades && StopTrade != true
As you can see, the EA looks at the Equity and then sets the bool value of the StopTrade variable to true. The EA then acknowledges the command and does not process anything under the StopTrade != true for one cycle, but then the bool value of the StopTrade gets reset I guess and trades continue.

Firstly, is there anyway for me to get this to do what I need it to do in the manner in which I am doing it?

Secondly, is there a function that I can use to simply tell the EA to quit?

All assistance is greatly appreciated.

NB.
Quote:
cutzpr - How Many Currently open Buy, and Sell Orders from EA
I think part of my code can help you with what you need.
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
  #1340 (permalink)  
Old 10-06-2008, 10:49 PM
cutzpr's Avatar
Member
 
Join Date: Jan 2008
Posts: 60
cutzpr is on a distinguished road
Well I had figured that a loop that would cycle threw all the open orders would be a start, but I wouldn't know what to tell the EA so that it will only look at the Orders placed by the EA and disregard the orders that I put in manually. 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
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


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


All times are GMT. The time now is 09:01 AM.



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