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
  #1 (permalink)  
Old 03-19-2009, 10:20 AM
Junior Member
 
Join Date: Sep 2008
Posts: 3
wisnuw is on a distinguished road
Cool Code Help : Avoid re Entry

Hi everybody. I need your help.

I try to make simple EA. But I have problem.

I want code to avoid my ea open new order when at the same bar
I already have close order.

Example : Pair USD/JPY Time Frame H1.
At 10.10 EA open Buy Order, Price going up. At 10.35 EA close
this position. After order close EA cannot make another order until
11.00 ( Same bar with close previous order ). EA can make order again
at 11.01 because this is a new bar.

Thank you for your 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
  #2 (permalink)  
Old 03-19-2009, 10:39 AM
Senior Member
 
Join Date: Oct 2005
Posts: 455
Perky is on a distinguished road
double bar;


when you make a trade then set

bar=Bars;

in the options to make the trade add

if bar!=Bars && <etc><etc> more of your code is req to make a better judgement
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-19-2009, 12:55 PM
Senior Member
 
Join Date: Nov 2005
Posts: 105
fxd01 is on a distinguished road
Quote:
Originally Posted by wisnuw View Post
Hi everybody. I need your help.

I try to make simple EA. But I have problem.

I want code to avoid my ea open new order when at the same bar
I already have close order.

Example : Pair USD/JPY Time Frame H1.
At 10.10 EA open Buy Order, Price going up. At 10.35 EA close
this position. After order close EA cannot make another order until
11.00 ( Same bar with close previous order ). EA can make order again
at 11.01 because this is a new bar.

Thank you for your help.
Either post the code or PM me, I can add the code for you.
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-19-2009, 01:23 PM
Junior Member
 
Join Date: Mar 2008
Posts: 7
marcxa is on a distinguished road
please can someone add arrows to this indy

hi all,

could a coder please add (green) up and (red) down arrows to indicator window when the lines cross on this indicator.

im trying to judge by eye but is it quite difficult

many thanks
Attached Files
File Type: mq4 AbsoluteStrength TimeFrame.mq4 (6.1 KB, 12 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
  #5 (permalink)  
Old 03-19-2009, 03:16 PM
Junior Member
 
Join Date: Sep 2008
Posts: 3
wisnuw is on a distinguished road
Question

Perky and fxd01, thanks for your help.

I already add code like Perky suggest but did not solve the problem.

What I want is if EA already close previous order. EA cannot
make another open order at the same bar of close previous order.

For TF H1
If EA open pending BUY_STOP at 10.30 the bar will be close at 10.59
and the order open at 11.10 ( next bar of open order ) if at 11.30 EA close the order. at 11.40 EA still can make another order because previous pending order was make at 10.30 ( last bar ).
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-19-2009, 03:44 PM
mas_awoo5182's Avatar
Senior Member
 
Join Date: Dec 2007
Posts: 122
mas_awoo5182 is on a distinguished road
Quote:
Originally Posted by wisnuw View Post
Perky and fxd01, thanks for your help.

I already add code like Perky suggest but did not solve the problem.

What I want is if EA already close previous order. EA cannot
make another open order at the same bar of close previous order.

For TF H1
If EA open pending BUY_STOP at 10.30 the bar will be close at 10.59
and the order open at 11.10 ( next bar of open order ) if at 11.30 EA close the order. at 11.40 EA still can make another order because previous pending order was make at 10.30 ( last bar ).
just add some code like this

int PrevOP;
int Order=OrdersHistoryTotal()
for(int i=Order-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==fals e) break;
if(OrderSymbol()!=Symbol() || OrderType()==OP_SELL || OrderType()==OP_BUY) continue;
//----
if(OrderCloseTime()>Time[0]) PrevOp++;
}
if (PrevOP>0) ===> don't trading..... OK

Thanks
__________________
Peace, Love, and Friendship, this is true life
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-21-2009, 03:53 AM
Junior Member
 
Join Date: Sep 2008
Posts: 3
wisnuw is on a distinguished road
Thanks mas awoo5182,

I will try to attach your code to my EA.
I hope this will solve my problem.
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 04-15-2009, 02:47 PM
Junior Member
 
Join Date: Aug 2007
Posts: 2
fx1001 is on a distinguished road
Need help how to auto reset EA after executed

Hi, I would like to need your expert help on how to reset EA value back to default value after it executed once. Thanks for your 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
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
Re-entry indicator; Midway; Late entry - request yuhu Indicators - Metatrader 4 12 02-12-2009 12:51 PM
a piece of code to remember an entry signal rwb181 MetaTrader 5 01-15-2009 07:43 PM
Avoid MT4 Broker Stop hunting with market orders only icm63 MetaTrader 6 09-06-2007 02:06 AM
best Indicator to detect strong trending to avoid scalps trading veematics Indicators - Metatrader 4 1 07-28-2007 07:03 PM
Lot sum after EA test / Avoid "CLOSE AT STOP" budhax Expert Advisors - Metatrader 4 4 02-16-2007 04:16 AM


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



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