Go Back   Forex-TSD > Discussion Areas > Metatrader 4
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
  #1 (permalink)  
Old 03-28-2007, 01:16 AM
Member
 
Join Date: Oct 2005
Posts: 65
tytian is on a distinguished road
how to get total each of buy/sellstop/limit?

anyone know how to get the total of each buy, sell, buystop, sellstop, buylimit and sellstop by the script?

mean OP_BUYSTOP always stay at 4 order, if miss one of OP_BUYSTOP order, delete and order again all pending order. no of OP_BUY

for(int j=OrdersTotal()-1;j>=0;j--)
{
OrderSelect(j,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == magic)
{
if(OrderType()==OP_BUYSTOP && OrdersTotal()==levelstop){
Comment( "Buystop" );}

have any guide to teach me.
I am the begining, newbie. ^^|
want make my ea

thanks

tytian

Last edited by tytian; 03-28-2007 at 03:24 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
  #2 (permalink)  
Old 03-28-2007, 04:44 AM
raj raj is offline
Member
 
Join Date: Apr 2006
Posts: 37
raj is on a distinguished road
int buytot = 0;
int selltot = 0;
int buystoptot = 0;
int sellstoptot = 0;
int buylimittot = 0;
int selllimittot = 0;
int magic=12345;
int i;

for(i = 0; i < OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderMagicNumber==magic)
{
if (OrderType() == OP_BUY) buytot += 1;
if ( OrderType() == OP_SELL) selltot += 1;
if (OrderType() == OP_BUYSTOP) buystoptot += 1;
if ( OrderType() == OP_SELLSTOP) sellstoptot += 1;
if (OrderType() == OP_BUYLIMIT) buylimittot += 1;
if ( OrderType() == OP_SELLLIMIT) selllimittot += 1;
}
}
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
  #3 (permalink)  
Old 03-28-2007, 04:48 AM
Senior Member
 
Join Date: Nov 2005
Posts: 172
mangman is on a distinguished road
Quote:
Originally Posted by tytian

mean OP_BUYSTOP always stay at 4 order, if miss one of OP_BUYSTOP order, delete and order again all pending order. no of OP_BUY

tytian
can you explain that more clearly?
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
  #4 (permalink)  
Old 03-28-2007, 05:23 AM
Member
 
Join Date: Oct 2005
Posts: 65
tytian is on a distinguished road
thank for reply.

i can't find each total for it..


tytian

Last edited by tytian; 04-01-2007 at 01:14 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
  #5 (permalink)  
Old 03-28-2007, 06:00 AM
Senior Member
 
Join Date: Nov 2005
Posts: 172
mangman is on a distinguished road
Is it that you place 1 Buy(market) and 4 BuyStop(pending) orders. When the price moves up and hits the first BuyStop order price and triggers it into a market order, you close the first market order and delete the remaining 3 pending orders and replace them with 4 new pending orders.

I just want to make sure I understand you clearly in order to assist you with the coding.
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
  #6 (permalink)  
Old 03-28-2007, 07:22 AM
Member
 
Join Date: Oct 2005
Posts: 65
tytian is on a distinguished road
Quote:
Originally Posted by mangman
Is it that you place 1 Buy(market) and 4 BuyStop(pending) orders. When the price moves up and hits the first BuyStop order price and triggers it into a market order, you close the first market order and delete the remaining 3 pending orders and replace them with 4 new pending orders.

I just want to make sure I understand you clearly in order to assist you with the coding.
thanks for reading mangman.

yes.

Last edited by tytian; 04-01-2007 at 01:15 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
  #7 (permalink)  
Old 03-28-2007, 09:35 AM
Member
 
Join Date: Oct 2005
Posts: 65
tytian is on a distinguished road
Quote:
Originally Posted by raj
int buytot = 0;
int selltot = 0;
int buystoptot = 0;
int sellstoptot = 0;
int buylimittot = 0;
int selllimittot = 0;
int magic=12345;
int i;

for(i = 0; i < OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderMagicNumber==magic)
{
if (OrderType() == OP_BUY) buytot += 1;
if ( OrderType() == OP_SELL) selltot += 1;
if (OrderType() == OP_BUYSTOP) buystoptot += 1;
if ( OrderType() == OP_SELLSTOP) sellstoptot += 1;
if (OrderType() == OP_BUYLIMIT) buylimittot += 1;
if ( OrderType() == OP_SELLLIMIT) selllimittot += 1;
}
}
thank you raj. its work. going to test 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
  #8 (permalink)  
Old 03-28-2007, 10:15 AM
raj raj is offline
Member
 
Join Date: Apr 2006
Posts: 37
raj is on a distinguished road
tytian,
Actually I borrowed that piece of code from Mangman for one of my EA's.
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
  #9 (permalink)  
Old 03-29-2007, 05:03 PM
Member
 
Join Date: Oct 2005
Posts: 65
tytian is on a distinguished road
Smile

thank you all. I just finished my first EA. congratulation to me. fully auto
Attached Images
File Type: gif tian.gif (32.7 KB, 158 views)

Last edited by tytian; 04-02-2007 at 02:36 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
  #10 (permalink)  
Old 03-29-2007, 05:20 PM
davidke20's Avatar
Senior Member
 
Join Date: Sep 2006
Location: 38° 53′ 51.61″ N, 77° 2′ 11.58″ W
Posts: 1,503
davidke20 is on a distinguished road
Thumbs up Very impressive

Quote:
Originally Posted by tytian
thank you all. I just finished my first EA. congratulation to me. fully auto
Very impressive. Good job. Not easy to reach this stage. Congrates.

Regards

David
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


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
Total Beginner question on using Metatrader lawed General Discussion 4 03-25-2009 08:43 PM
Order Limit clippertm Questions 1 07-16-2007 03:04 PM


All times are GMT. The time now is 03:21 AM.



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