#### Topic: How to program this into FSB?

http://www.forexfactory.com/showthread.php?t=243045

#### Re: How to program this into FSB?

I'll see what I can do. From the thread, it looks like an indicator plus a strategy. Do you have a link to a general description of how to calculate the NonLagMA, and the strategy? I'll try to look through the posted code, but general descriptions are usually easier to follow.

#### Re: How to program this into FSB?

krog wrote:

I'll see what I can do. From the thread, it looks like an indicator plus a strategy. Do you have a link to a general description of how to calculate the NonLagMA, and the strategy? I'll try to look through the posted code, but general descriptions are usually easier to follow.

Thanks, Krog,
Will it help?

http://www.forex-tsd.com/indicators-metatrader-4/2613-nonlagging-tools.html

#### Re: How to program this into FSB?

Thanks -- not quite, was looking for something like

value = sum(close(i)*someWeight*(1.0-period)) / sum(weight*average*log(i))

(I just made that up for example, has no meaning)
But no need now -- I think I'm almost done, only one more piece to work out, may be able to finish tomorrow.

#### Re: How to program this into FSB?

ok, I think I've got it put together to match the EA. Try this out, let me know if it works or not. For now while testing it, I'm going to call the file "DoNotUse". It will show up in your indicators as "NonLagMA". When it no longer shows that many bugs, I'll repost the final version as "NonLagMA".

EA - Length, FSB - Period. EA - Displace, FSB - Shift: this moves the indicator to the right. EA - Deviation, FSB - Vertical Displacement: this shifts the curve up or down.
The EA calculates the indicator on top of a Linear Non Weighted Moving Average, but does not allow changing the parameter. I added a parameter for it. Leave at 1 default to always match the EA.

I used the opening and closing logic from FSB's Moving Average indicator. Let me know if there are other logic you would like to see.

I've done a bit of quick testing to ensure the values match and it does not crash FSB. The more we try it out, the more likely to catch problems. Use it as you would any other indicator, and post if things don't work. Some examples of things to look for -- values don't match when using exactly same quotes; FSB puts up the crash dialog to quit or continue, and if you continue it draws a red X on a chart area; one of the parameters results in no trades, or does not change anything; does not work for a particular cross, or gives impossible values.

Also, if you could test it against FSTrader, that would be great. There looking for mismatched trades.

#### Re: How to program this into FSB?

Nice catch with the Optimizer. What happens is you have very few bars (like 300 or so) but the indicator  requires 5x period of bars -- so 70x5 = 350, more than in your data set. I've attached DoNotUse2 to fix this, it sets the max for that parameter to 1/5 the number of bars in your data - 10. If you change the number of bars in your data by changing Market > Data Horizon ..., it should set it to your setting, or the maximum possible without crashing. Also, it should avoid the Optimizer stepping it up to a high enough value to crash. I could get around the crash, but to get the displayed parameter to refresh, you will have to open and close that slot 2 times. Unfortunately don't know how to work around this, but I reckoned a little bit of confusion is better than crashing.

For the Shift parameter and OOS, that has to do with the period, not the shift, not a bug. Set the period to 5, then check where OOS line is. Then, set it to 100, and check where the OOS line is. It is because the higher period cuts off more of the beginning data, so the displayed equity graph is a shorter period of time.

#### Re: How to program this into FSB?

Changing OOS position when optimizing the period is unpleasent side efect. I'll try to mfind some solution. Probably we can fix OOS as percent of data bars instead to testing bars.