Forex
Google
New signals service!

Go Back   Forex Trading > Trading systems > Ema Cross


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (24) Thread Tools Display Modes
  #31 (permalink)  
Old 11-06-2006, 03:00 PM
deepdrunk's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 310
deepdrunk is on a distinguished road
Code:
for(int shift=limit; shift>=0; shift--)
   {
       UpBuffer[shift] = buffer[shift];
       DownBuffer[shift] = buffer[shift];
       Buffer3[shift] = buffer[shift];
   }                   
   for(shift=limit; shift>=0; shift--)
   {
      if (buffer[shift+1]>buffer[shift])
      {
         UpBuffer[shift+1] = EMPTY_VALUE;
         //Buffer3[i+1] = EMPTY_VALUE;
      }
      else if (buffer[shift+1]<buffer[shift] )
      {
         DownBuffer[shift+1] = EMPTY_VALUE;
//Buffer3[i+1] = EMPTY_VALUE;      
      } 
      else
      {
         UpBuffer[shift+1] = CLR_NONE;
         DownBuffer[shift+1] = CLR_NONE;
      }
   }                   
   return(0);
only thing what is suspitios to me here is that 'shift';maybe it is the reason for repainting,cant we use it without shift ? like bar[1] bar[0] sorry but it is out of my mql4 knowledg.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #32 (permalink)  
Old 11-06-2006, 03:13 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Lightbulb shift is an INDICATOR itself!

Quote:
Originally Posted by deepdrunk
Code:
for(int shift=limit; shift>=0; shift--)
   {
       UpBuffer[shift] = buffer[shift];
       DownBuffer[shift] = buffer[shift];
       Buffer3[shift] = buffer[shift];
   }                   
   for(shift=limit; shift>=0; shift--)
   {
      if (buffer[shift+1]>buffer[shift])
      {
         UpBuffer[shift+1] = EMPTY_VALUE;
         //Buffer3[i+1] = EMPTY_VALUE;
      }
      else if (buffer[shift+1]<buffer[shift] )
      {
         DownBuffer[shift+1] = EMPTY_VALUE;
//Buffer3[i+1] = EMPTY_VALUE;      
      } 
      else
      {
         UpBuffer[shift+1] = CLR_NONE;
         DownBuffer[shift+1] = CLR_NONE;
      }
   }                   
   return(0);
only thing what is suspitios to me here is that 'shift';maybe it is the reason for repainting,cant we use it without shift ? like bar[1] bar[0] sorry but it is out of my mql4 knowledg.
Any indicator uses shift (which here is equal to limit and limit equal to Bars-counted_bars)
What does it mean:

In the first load of the indicator (not only my indicator but it's a general topic for any indicator wrote in MQL4,VT or EL) get the count of bars on chart and make the indicator calculation then draw the indicator.

afterwards, Everytime you get a new tick draw the new bar of indicator.
So, in the first load of the indicator limit will equal to the count of the bar and afterwards it will always be 0. So we using the current bar (Bar[0]) and the previous bar (Bar[1]).

This is another variation of the code and I think this is better (I'll update the indicator in xpworx.com)!

PHP Code:
for(int shift=0shift<limitshift++)
   {
       
UpBuffer[shift] = buffer[shift];
       
DownBuffer[shift] = buffer[shift];
       
Buffer3[shift] = buffer[shift];
   }                   
   for(
shift=0shift<limitshift++)
   {
      if (
buffer[shift]<buffer[shift+1])
      {
         
UpBuffer[shift] = EMPTY_VALUE;
      }
      else if (
buffer[shift]>buffer[shift+1] )
      {
         
DownBuffer[shift] = EMPTY_VALUE;
      } 
      else
      {
         
UpBuffer[shift] = CLR_NONE;
         
DownBuffer[shift] = CLR_NONE;
      }
   } 
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #33 (permalink)  
Old 11-06-2006, 03:26 PM
viat's Avatar
Member
 
Join Date: Sep 2005
Posts: 32
viat is on a distinguished road
HI there.
Off-coarse it will repaint past bars bcoz it's MA of "n" periods of bars. If you want nonrepaint one just put MA period value to 1!
Thank you Codersguru for your amazing work.

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 11-06-2006, 03:36 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Unhappy

Quote:
Originally Posted by viat
HI there.
Off-coarse it will repaint past bars bcoz it's MA of "n" periods of bars. If you want nonrepaint one just put MA period value to 1!
Thank you Codersguru for your amazing work.

Cheers
Thanks viat!

You are right! There's no indicator that's not repaint (calculating) the past!

But repainting the past they meant is "An indicator that changes the drawing he made in the past" or they meant "An indicator that calculate the future if the past (-1 index indicator)". or they mean "It's too bad to share your indicator, or you share it because it's bad"!

Anyway, It's a moving average indicator that colored itself according too the value of the previous bar! if this means it repaint the past I'll remove it from my site and close the thread! if it does not repaint the past I'll remove it too from my site but I'll not close the thread! kidding!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #35 (permalink)  
Old 11-06-2006, 04:01 PM
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
Codersguru, I am not at all accusing you of maliciously making an indicator, but you need to warn people about this indicator, that it DOES repaint in the past.

For instance, all you need to do is look at a 1M time frame and watch the color of the indicator BEFORE the previous bar (and in some cases before the previous 2 bars) change color. This makes it impossible to backtest, and not a good indicator to trade live.

Afterall, let's say you are in a trade short, and then the indicator changes BEFORE your current bar to green (long) indicating that you SHOULD have gone long before the open of the bar. This is impossible to do.

Again I say, watch your 1M timeframe and watch how the indicator CHANGES COLOR in PREVIOUS bars.

Quote:
Originally Posted by codersguru
Hi there!

1- I don't know what's going on! I'm sharing all of my works and didn't cheat one of you before! Any member here denies that???

2- Xp moving average is Colored Moving Average no less no more! So, if the moving averages indicators repaint the past (I'm sure they are not) then xpMA repaints the past.

The logic of coloring is very simple:

1- If the previous bar value is Greaterthan the current bar value color the moving average is Green.
2- If the previous bar value is Lesser than the current bar value color the moving average is Red.
3-If the previous bar value is Equal to the current bar value color the moving average is Yellow.

Repainting the past or repainting the future:
I want to mention another thing here. Repainting the past means repainting the future for the history!
I mean, I can write an indicator that looks for the next bar value which it exist only in the past (because in the current bar there's no next bar yet) That's the meaning of repainting the past I think!

Well, The answer is: XP Moving Average does not repaint the past!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #36 (permalink)  
Old 11-06-2006, 04:07 PM
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
Codersguru, are you a trader or merely a coder? If merely a coder, I am sure this indicator is very helpful for all kinds of things that coders do. If you are a trader, would you please tell us how you trade this indicator?

And specifically, what do you do if you are in a long trade and the indicator changes color 2 bars behind you? Do you quickly reverse position? Or do you stay in the trade hoping the indicator will change back according to price movement?

I'm very interested in knowing how someone would trade with an indicator that changes color in previous bars.

Also, how does one backtest using this indicator? I mean, I am sure I could develop an indicator that looks back 50 bars and changes all the previous bars to red when the market was sinking, and all the previous bars to green when the market was climbing.

Then I could release the indicator and people would look at it, backtest it, and think they had the holy grail. Problem is, I would sooner or later have to explain to them that indicators that change the colors previously are no good in backtesting, and not much good in live trading.

Please, help me understand how you actually trade with this indicator.

Quote:
Originally Posted by codersguru
Thanks viat!

You are right! There's no indicator that's not repaint (calculating) the past!

But repainting the past they meant is "An indicator that changes the drawing he made in the past" or they meant "An indicator that calculate the future if the past (-1 index indicator)". or they mean "It's too bad to share your indicator, or you share it because it's bad"!

Anyway, It's a moving average indicator that colored itself according too the value of the previous bar! if this means it repaint the past I'll remove it from my site and close the thread! if it does not repaint the past I'll remove it too from my site but I'll not close the thread! kidding!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #37 (permalink)  
Old 11-06-2006, 04:52 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Unhappy

Quote:
Originally Posted by mikejody
Codersguru, are you a trader or merely a coder? If merely a coder, I am sure this indicator is very helpful for all kinds of things that coders do. If you are a trader, would you please tell us how you trade this indicator?

And specifically, what do you do if you are in a long trade and the indicator changes color 2 bars behind you? Do you quickly reverse position? Or do you stay in the trade hoping the indicator will change back according to price movement?

I'm very interested in knowing how someone would trade with an indicator that changes color in previous bars.

Also, how does one backtest using this indicator? I mean, I am sure I could develop an indicator that looks back 50 bars and changes all the previous bars to red when the market was sinking, and all the previous bars to green when the market was climbing.

Then I could release the indicator and people would look at it, backtest it, and think they had the holy grail. Problem is, I would sooner or later have to explain to them that indicators that change the colors previously are no good in backtesting, and not much good in live trading.

Please, help me understand how you actually trade with this indicator.
It does not repaint the past!

Note: To be sure we are using the same version of the indicator please go to:
XP Moving Average v2
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #38 (permalink)  
Old 11-06-2006, 05:01 PM
viat's Avatar
Member
 
Join Date: Sep 2005
Posts: 32
viat is on a distinguished road
Quote:
Originally Posted by mikejody
Codersguru, are you a trader or merely a coder? If merely a coder, I am sure this indicator is very helpful for all kinds of things that coders do. If you are a trader, would you please tell us how you trade this indicator?

And specifically, what do you do if you are in a long trade and the indicator changes color 2 bars behind you? Do you quickly reverse position? Or do you stay in the trade hoping the indicator will change back according to price movement?

I'm very interested in knowing how someone would trade with an indicator that changes color in previous bars.

Also, how does one backtest using this indicator? I mean, I am sure I could develop an indicator that looks back 50 bars and changes all the previous bars to red when the market was sinking, and all the previous bars to green when the market was climbing.

Then I could release the indicator and people would look at it, backtest it, and think they had the holy grail. Problem is, I would sooner or later have to explain to them that indicators that change the colors previously are no good in backtesting, and not much good in live trading.

Please, help me understand how you actually trade with this indicator.
Hi mikejody.
Read post#33 please. Then if you don't understand how MA's works just Google it. If you want to trade only using 1 MA try E/E on slope change. But I think you need more than one indicator for good E/E.
XPMA works like usual MA but have had better visual effect.
Hope this help.

viat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #39 (permalink)  
Old 11-06-2006, 05:21 PM
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
If you look right now on Cable 1M, the 2018 GMT bar is at 1.8967, and there are 3 previous bars of red indicator. However, when the price goes to 1.8968 or higher, the indicator 2 BARS PREVIOUSLY changes color from red to yellow.

That is, the bar at 2017, the PREVIOUS bar's indicator, turns color from red to yellow. THIS is what we all mean by "repainting the past." In other words, you are in this trade short right now, but when the price goes up one tick the indicator makes it look like you should have been OUT of the trade at least 1-2 bars EARLIER.

Why is this so difficult to understand?

Quote:
Originally Posted by codersguru
It does not repaint the past!

Note: To be sure we are using the same version of the indicator please go to:
XP Moving Average v2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #40 (permalink)  
Old 11-06-2006, 05:50 PM
Senior Member
 
Join Date: Jun 2006
Posts: 368
fxnewbie is on a distinguished road
The way i am using it

The way i am using this indicator:
I am placing in 30 min. chart:
- XP MA 4
- XP MA 20
- XP MA 90
For entries, i wait until all XP MAs changes at the same collor
For exits, i wait until XP MA 20 changes his collor, but the change of XP MA 4 means a warning signal.
I am just starting to test indicator that way. So far, with good results.

THANKS, CODERSGURU !!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
moving average, moving average forex

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/ema-cross/4430-xp-moving-average.html
Posted By For Type Date
Dolly System - Singapore Forex Trading Forum This thread Refback 07-28-2008 02:52 PM
The Simple System - Page 45 This thread Refback 06-09-2008 09:08 PM
Coders? This thread Refback 04-21-2008 05:30 PM
Singapore Forex Trading Forum - Re:Dolly System - Singapore Forex Trading This thread Refback 04-10-2008 10:56 PM
Forex | Trader Blog | Forex Trading | FX Operator - Re:Dolly System - FX Operator This thread Refback 03-12-2008 01:16 PM
Forum Forum - Moving Averages (Simple, Exponential, Weighted, etc) This thread Refback 02-14-2008 10:34 AM
Coders? This thread Refback 02-07-2008 08:02 PM
FX Operator | Singapore Forex (FX) Currency Trading | System, Good, Using, Still, Here This thread Refback 12-26-2007 04:27 PM
Untitled document This thread Refback 11-16-2007 02:21 PM
WoW ! Oh My God ! Guys take a look at this indicator ! - Forex Forum This thread Refback 11-14-2007 10:35 PM
Is there such a beast This thread Refback 10-12-2007 11:03 AM
Is there such a beast This thread Refback 10-11-2007 07:37 PM
Is there such a beast This thread Refback 10-11-2007 07:01 PM
Forex (FX) Trading | Currency Market | FX Operator - Dolly System - This thread Refback 10-02-2007 01:05 PM
WoW ! Oh My God ! Guys take a look at this indicator ! - Forex Forum This thread Refback 09-29-2007 01:53 PM
INDIKATOR XP for META $ - GoldAge Forums This thread Refback 09-09-2007 12:55 PM
WoW ! Oh My God ! Guys take a look at this indicator ! - Page 2 - Forex Forum Post #367 Pingback 08-23-2007 04:19 PM
The Simple System - Page 45 This thread Refback 08-15-2007 12:54 AM
The Simple System - Page 45 This thread Refback 08-06-2007 07:43 AM
The Simple System - Page 45 This thread Refback 08-06-2007 07:05 AM
The Simple System - Page 45 This thread Refback 08-05-2007 03:15 PM
WoW ! Oh My God ! Guys take a look at this indicator ! - Forex Forum This thread Pingback 07-18-2007 07:01 PM
Moving Averages (Simple, Exponential, Weighted, etc) - Page 2 - FXAddict Community This thread Refback 07-03-2007 11:52 AM
Forex (FX) Trading | Currency Market | FX Operator - Dolly System - This thread Refback 06-26-2007 04:40 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post