Simple Moving Average to plot 1 Number of Periods

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Simple Moving Average to plot 1 Number of Periods

Postby tradingkevin » Thu Jul 15, 2010 10:53 am

Hi guys,

I am trying to plot on top of my Candlestick chart a Simple Moving Average with 1 Number of Periods but I get this error message :

" The input value is incorret. The value must be in the range from 2 to 10000. "

Could somebody code it so that I can input 1 has my Number of Periods ?

Thanks
tradingkevin
tradingkevin
FXCodeBase: Confirmed User
 
Posts: 9
Joined: Wed Feb 03, 2010 2:22 pm

Re: Simple Moving Average to plot 1 Number of Periods

Postby Nikolay.Gekht » Thu Jul 15, 2010 11:39 am

Hm... Never thought that it could be required.

Ok. I'll ask to remove this limitation in the next release.

Right now you can:

1) Copy mva.lua and mva.lua.rc from the C:\Program Files\Candleworks\FXTS2\indicators\Standard\
to C:\Program Files\Candleworks\FXTS2\indicators\Custom\

2) Rename mva.lua to mva1.lua and mva.lua.rc to mva1.lua.rc in the C:\Program Files\Candleworks\FXTS2\indicators\Custom\ folder.

3) Open mva.lua in notepad (rightclick on file, choose Open With..., then choose notepad).

4) Replace 2 with 1 the following line
indicator.parameters:addInteger("N", resources:get("param_N_name"), resources:get("param_N_description"), 14, 2, 1000);

After change it must look like:
indicator.parameters:addInteger("N", resources:get("param_N_name"), resources:get("param_N_description"), 14, 1, 1000);

5) Restart TS.

Voila. Now you have two indicators - MVA and MVA1. The second allows to choose 1 in N parameter.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: Simple Moving Average to plot 1 Number of Periods

Postby tradingkevin » Mon Jul 19, 2010 11:41 am

Thanks a lot Nikolay :P Works great.

I use 1 SMA and candlestick to help me see the swings better

Appreciate it..

sincerely
tradingkevin
tradingkevin
FXCodeBase: Confirmed User
 
Posts: 9
Joined: Wed Feb 03, 2010 2:22 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 26 guests