Error when using WMA in Strategy

How to create strategies and indicators
Message
Author
User avatar
Tantalus
Posts: 302
Joined: Fri Mar 23, 2007 3:51 pm
Contact:

Error when using WMA in Strategy

#1 Postby Tantalus » Thu May 14, 2009 4:53 pm

I'm trying to write a strategy that uses a weighted moving average. I used this line to create the indicator:

Code: Select all

  hWMA_High := CreateIndicator(Currency, TimeFrame, 'MovingAverage', '12;0;Weighted (WMA);High');


But I receive this message in the Journal:

Code: Select all

Wrong option value: Weighted (WMA), (Moving Average)


and instead it creates a SMA using the Close. What code should I use for MA types other than simple?
Last edited by Tantalus on Tue Jun 09, 2009 5:03 pm, edited 1 time in total.
Tantalus Research - Developing 21st Century Trading Systems.

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Error when using WMA in Strategy

#2 Postby Terranin » Thu May 14, 2009 11:27 pm

Tantalus wrote:I'm trying to write a strategy that uses a weighted moving average. I used this line to create the indicator:

Code: Select all

  hWMA_High := CreateIndicator(Currency, TimeFrame, 'MovingAverage', '12;0;Weighted (WMA);High');


But I receive this message in the Journal:

Code: Select all

Wrong option value: Weighted (WMA), (Moving Average)


and instead it creates a SMA using the Close. What code should I use for MA types other than simple?


New version of Moving Average uses 3 integer parameters first '12;0;0;Weighted (WMA);High' . For any indicator you need to send parameters in the same number and order as you can see in its dialog window.
Hasta la vista
Mike

User avatar
Tantalus
Posts: 302
Joined: Fri Mar 23, 2007 3:51 pm
Contact:

#3 Postby Tantalus » Fri May 15, 2009 7:28 am

Ah, I see. The help file only tells about two params. Can you explain what the third one is?

Thanks.
Last edited by Tantalus on Tue Jun 09, 2009 5:04 pm, edited 2 times in total.
Tantalus Research - Developing 21st Century Trading Systems.

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#4 Postby Terranin » Fri May 15, 2009 10:55 am

Tantalus wrote:Ah, I see. The help file only tells about two params. Can you explain what the third one is?

Thanks.


The third one is vertical shift in points so you can make bands from moving averages.
Hasta la vista

Mike


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 7 guests