Forex



Go Back   Forex Trading > Discussion Areas > Setup 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
  #1 (permalink)  
Old 06-26-2007, 01:23 PM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
Price

Is there any way of locking the price value to a given point in time, i know that you can display a set price for the Close of a candle for example however i want to display the price at the point that an Alert is given for say the crossover of 2 MA's just like the read out you can get with the pop up Alert box, all i get at present is a price when the signal is given but the price then proceeds to update with the current price and i cannot seem to lock it to the actual signal time. Any help or suggestions would be most appreciated.

cja
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-26-2007, 01:41 PM
Senior Member
 
Join Date: Nov 2005
Posts: 105
fxd01 is on a distinguished road
Quote:
Originally Posted by cja View Post
Is there any way of locking the price value to a given point in time, i know that you can display a set price for the Close of a candle for example however i want to display the price at the point that an Alert is given for say the crossover of 2 MA's just like the read out you can get with the pop up Alert box, all i get at present is a price when the signal is given but the price then proceeds to update with the current price and i cannot seem to lock it to the actual signal time. Any help or suggestions would be most appreciated.

cja
cja,

Why not just store the price (at the time of crosssing) in a variable and use that variable to display/pop-up/print etc? (It sounds simple. May be I did not understand your question properly).

Thx.
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-26-2007, 06:04 PM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
Setting price

Quote:
Originally Posted by fxd01 View Post
cja,

Why not just store the price (at the time of crosssing) in a variable and use that variable to display/pop-up/print etc? (It sounds simple. May be I did not understand your question properly).

Thx.
Can you give me an example of what you are talking about, and i will see if i can apply it to my situation, 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
  #4 (permalink)  
Old 06-26-2007, 06:36 PM
Senior Member
 
Join Date: Nov 2005
Posts: 105
fxd01 is on a distinguished road
Quote:
Originally Posted by cja View Post
Can you give me an example of what you are talking about, and i will see if i can apply it to my situation, thanks
cja,

If I understood your question correctly, this may work (otherwise my appologies).

1. define couple of variales before the start() function. Note that the crossPrice variable is created as static variable so that the value assigned to remains static until changed


static double crossPrice;

int crossDirection; //1=up, 2=down, 0=no direction


2. check the crossing of the MA's (I just used a period of 6 & 13). If the MA's crossed, assign the price (it could be ask, bid or (ask+bid/2).


crossDirection=0;

double ma_06_0=iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,0);
double ma_13_0=iMA(NULL,0,13,0,MODE_SMA,PRICE_CLOSE,0);

double ma_06_1=iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,1);
double ma_13_1=iMA(NULL,0,13,0,MODE_SMA,PRICE_CLOSE,1);


if (ma_06_0>ma_13_0 && ma_06_1<ma_13_1)
{
crossPrice=Ask; // or bid or (ask+bid)/2
crossDirection=1; // ie. direction is up
}

if (ma_13_0>ma_06_0 && ma_13_1<ma_06_1)
{
crossPrice=Bid; // or bid or (ask+bid)/2
crossDirection=2; // ie. direction is down
}


The Value in crossPrice remains unchanged until the next cross occurs. Please let me know if this is what you are looking for.
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-26-2007, 10:16 PM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
Static Price

Quote:
Originally Posted by fxd01 View Post
cja,

If I understood your question correctly, this may work (otherwise my appologies).

1. define couple of variales before the start() function. Note that the crossPrice variable is created as static variable so that the value assigned to remains static until changed


static double crossPrice;

int crossDirection; //1=up, 2=down, 0=no direction


2. check the crossing of the MA's (I just used a period of 6 & 13). If the MA's crossed, assign the price (it could be ask, bid or (ask+bid/2).


crossDirection=0;

double ma_06_0=iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,0);
double ma_13_0=iMA(NULL,0,13,0,MODE_SMA,PRICE_CLOSE,0);

double ma_06_1=iMA(NULL,0,6,0,MODE_SMA,PRICE_CLOSE,1);
double ma_13_1=iMA(NULL,0,13,0,MODE_SMA,PRICE_CLOSE,1);


if (ma_06_0>ma_13_0 && ma_06_1<ma_13_1)
{
crossPrice=Ask; // or bid or (ask+bid)/2
crossDirection=1; // ie. direction is up
}

if (ma_13_0>ma_06_0 && ma_13_1<ma_06_1)
{
crossPrice=Bid; // or bid or (ask+bid)/2
crossDirection=2; // ie. direction is down
}


The Value in crossPrice remains unchanged until the next cross occurs. Please let me know if this is what you are looking for.
Thanks for your time to explain this i will try it out later tonight and let you know how it goes.

cja
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-26-2007, 11:12 PM
Senior Member
 
Join Date: Nov 2005
Posts: 105
fxd01 is on a distinguished road
Quote:
Originally Posted by cja View Post
Thanks for your time to explain this i will try it out later tonight and let you know how it goes.

cja
No problem cja. I will be happy if I am of any help. I have seen many wonderful indicators created by 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
  #7 (permalink)  
Old 06-27-2007, 09:00 AM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
Static price

Quote:
Originally Posted by fxd01 View Post
No problem cja. I will be happy if I am of any help. I have seen many wonderful indicators created by you.

Thanks for the code - i applied it to my price signal and it certainly works as far as locking the price at the signal time but if you change timeframes the price updates - any ideas?? i will have more of a look into it tonight.

Thanks for your help once more

cja
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 06-27-2007, 10:21 AM
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
Why not write it to an external log file along with time, date and any other relevant variables?

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
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
price


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
(FPI) predictive price Nicholishen Indicators - Metatrader 4 104 09-27-2009 01:41 AM
MTF Price keris2112 Indicators - Metatrader 4 19 03-07-2009 08:53 PM
Price System Kurka Fund Expert Advisors - Metatrader 4 0 11-18-2006 08:14 PM
Price EACAN Questions 4 06-23-2006 10:27 AM


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



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