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 06-30-2008, 10:49 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Check difference of previous bar

Hello, I know I can check previous bar open and close with this;
Close[1]>Open[1]) // check if close price was higher than open

but what do I add to check the difference of the two? what I mean is if I want to check if the bar closed 30 pips or whatever pips away from bar open?

Can I do something like this?;
Close[1] + 30 > Open[1]) // check if close was 30 pips more than close

Close[1] - 30 < Open[1]) // check if close was 30 pips less than open

What if I didn't want to be so precise, like 30 pips or more, not 30 exact?

Thanks

Last edited by matrixebiz; 06-30-2008 at 10:56 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
  #2 (permalink)  
Old 06-30-2008, 11:15 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 655
Blog Entries: 1
IN10TION is on a distinguished road
:: if( MathAbs(Close[1]-Open[1])/Point >= 30 ) {...;}
:: everything equal or more then 30 then ... do something
Quote:
Originally Posted by matrixebiz View Post
Hello, I know I can check previous bar open and close with this;
Close[1]>Open[1]) // check if close price was higher than open

but what do I add to check the difference of the two? what I mean is if I want to check if the bar closed 30 pips or whatever pips away from bar open?

Can I do something like this?;
Close[1] + 30 > Open[1]) // check if close was 30 pips more than close

Close[1] - 30 < Open[1]) // check if close was 30 pips less than open

What if I didn't want to be so precise, like 30 pips or more, not 30 exact?

Thanks
__________________
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
  #3 (permalink)  
Old 06-30-2008, 11:32 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
:: if( MathAbs(Close[1]-Open[1])/Point >= 30 ) {...;}
:: everything equal or more then 30 then ... do something
So I would use this for Buy order if Close is > Open by 30 or more;
if( MathAbs(Close[1]>Open[1])/Point >= 30 )

and this for Sell order if close is < Open by 30 or more;
if( MathAbs(Close[1]<Open[1])/Point >= 30 )

??
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 06-30-2008, 11:49 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 655
Blog Entries: 1
IN10TION is on a distinguished road
:: yes, it will work for buy & sell if the differences is more or equal to 30, of course if you want to have this as a choice in buy or sell then ...

:: if( (Close[1]-Open[1])/Point <= -30 ) Sell

:: if( (Close[1]-Open[1])/Point >= 30 ) Buy

Quote:
Originally Posted by matrixebiz View Post
So I would use this for Buy order if Close is > Open by 30 or more;
if( MathAbs(Close[1]>Open[1])/Point >= 30 )

and this for Sell order if close is < Open by 30 or more;
if( MathAbs(Close[1]<Open[1])/Point >= 30 )

??
__________________
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
  #5 (permalink)  
Old 06-30-2008, 11:53 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
:: yes, it will work for buy & sell if the differences is more or equal to 30, of course if you want to have this as a choice in buy or sell then ...

:: if( (Close[1]-Open[1])/Point <= -30 ) Sell

:: if( (Close[1]-Open[1])/Point >= 30 ) Buy

Tried this but all it's doing is Buy orders ??
if( MathAbs(Close[1]-Open[1])/Point >= 30 ) Order = BuySignal;
if( MathAbs(Close[1]-Open[1])/Point <= -30 ) Order = SellSignal;

Woops I had something wrong in my other code

Last edited by matrixebiz; 06-30-2008 at 11:55 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
  #6 (permalink)  
Old 06-30-2008, 11:58 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Nope something is wrong. I did this:
if( MathAbs(Close[1]-Open[1])/Point >= 30000 ) Order = BuySignal;
if( MathAbs(Close[1]-Open[1])/Point <= -30 ) Order = SellSignal;

and no Sell orders are placed.
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 07-01-2008, 12:04 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 655
Blog Entries: 1
IN10TION is on a distinguished road
:: Yes the first one is not suitable, I thought you were looking only for a difference, either which direction it went...

:: I put the other one 2 post back hope that helps
Quote:
Originally Posted by matrixebiz View Post
Nope something is wrong. I did this:
if( MathAbs(Close[1]-Open[1])/Point >= 30000 ) Order = BuySignal;
if( MathAbs(Close[1]-Open[1])/Point <= -30 ) Order = SellSignal;

and no Sell orders are placed.
__________________
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
  #8 (permalink)  
Old 07-01-2008, 12:05 AM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
I had to take away the minus sign for -30;
if( MathAbs(Close[1]-Open[1])/Point >= PipDifference ) Order = BuySignal;
if( MathAbs(Close[1]-Open[1])/Point <= PipDifference ) Order = SellSignal;

and does open Buys and Sells but
It doesn't seem to be obeying the conditions. It opens another order right when the other order closes.

It's not opening the trade ONLY when the more than 30 pips difference is met, weird

Last edited by matrixebiz; 07-01-2008 at 12:09 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
  #9 (permalink)  
Old 07-01-2008, 12:11 AM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Only opening Buy orders

Last edited by matrixebiz; 07-01-2008 at 12:19 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
  #10 (permalink)  
Old 07-01-2008, 12:14 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 655
Blog Entries: 1
IN10TION is on a distinguished road
:: please, change to this

:: if( (Close[1]-Open[1])/Point <= -30 ) Sell

:: if( (Close[1]-Open[1])/Point >= 30 ) Buy



Quote:
Originally Posted by matrixebiz View Post
I had to take away the minus sign for -30;
if( MathAbs(Close[1]-Open[1])/Point >= PipDifference ) Order = BuySignal;
if( MathAbs(Close[1]-Open[1])/Point <= PipDifference ) Order = SellSignal;

and does open Buys and Sells but
It doesn't seem to be obeying the conditions. It opens another order right when the other order closes.

It's not opening the trade ONLY when the more than 30 pips difference is met, weird
__________________
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
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
Previous day breakout manager Expert Advisors - Metatrader 4 5 11-22-2007 11:33 AM
How to check for check for currency symbol tak145 Expert Advisors - Metatrader 4 1 05-12-2007 02:16 PM
Tracking previous trade miawluttu Metatrader 4 4 10-26-2006 04:38 AM
Previous high and low phildunn Metatrader 4 3 03-21-2006 04:10 PM
Some previous versions (before 0_34c) newdigital TSD Expert Advisors 0 10-24-2005 07:03 PM


All times are GMT. The time now is 06:55 AM.



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