Welcome to the Traders Laboratory Forums.
TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation.

Reply
Old 09-28-2011, 04:39 PM   #1

Join Date: Sep 2011
Posts: 3
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Help with Moving Average Label

Hi,

I was wondering if there is a script or a way to display the number of the moving average graphically on the moving average line?

Here is a screen shot of my tradestation daily chart mocked up with what I would like to do: http://screencast.com/t/nA9x96kP7

Any code out there that can help with this?

Thank you in advance.

Tem
tbalanco is offline  
Reply With Quote
Old 09-28-2011, 05:39 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Help with Moving Average Label

Quote:
Originally Posted by tbalanco »
Hi,

I was wondering if there is a script or a way to display the number of the moving average graphically on the moving average line?

Here is a screen shot of my tradestation daily chart mocked up with what I would like to do: 2011-09-28_1630 - Tem_B's library

Any code out there that can help with this?

Thank you in advance.

Tem
posting the same question multiple time will not get you answers any quicker.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 09-28-2011, 11:29 PM   #3

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: Help with Moving Average Label

Quote:
Originally Posted by tbalanco »
Hi,

I was wondering if there is a script or a way to display the number of the moving average graphically on the moving average line?

Here is a screen shot of my tradestation daily chart mocked up with what I would like to do: 2011-09-28_1630 - Tem_B's library

Any code out there that can help with this?

Thank you in advance.

Tem
Try this:

Code:
inputs:  Price( Close ), Length( 9 );
variables:  Avg( 0 ) ;
	
Avg = AverageFC( Price, Length ) ;

plot1(Avg, "MA");

Once
Begin
	Value1=Text_new(D, T, H, "Start");
End;

Text_SetString(Value1, "         " +  NumToStr(Length,0));
Text_SetLocation(Value1, D, T, Avg);
Text_SetColor(Value1, Red);
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote
Old 02-29-2012, 05:41 PM   #4

Join Date: Sep 2011
Posts: 3
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Help with Moving Average Label

Hi,

I appreciate your assistance. Would you mind showing me how I can edit my existing standard code in tradestation included below with your suggestion?

Again, I would greatly appreciate it. Unfortunately, not a programmer even at this basic level.

My Code from tradestation standard 3 averages:


inputs:
Price( Close ),
FastLength( 4 ),
MedLength( 9 ),
SlowLength( 18 ),
Displace( 0 ) ;

variables:
FastAvg( 0 ),
MedAvg( 0 ),
SlowAvg( 0 ) ;

FastAvg = AverageFC( Price, FastLength ) ;
MedAvg = AverageFC( Price, MedLength ) ;
SlowAvg = AverageFC( Price, SlowLength ) ;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot1[Displace]( FastAvg, "FastAvg" ) ;
Plot2[Displace]( MedAvg, "MedAvg" ) ;
Plot3[Displace]( SlowAvg, "SlowAvg" ) ;

{ Alert criteria }
if Displace <= 0 then
begin
Condition1 = Price > FastAvg and FastAvg > MedAvg and MedAvg > SlowAvg ;
if Condition1 and Condition1[1] = false then
Alert( "Bullish alert" )
else
begin
Condition2 = Price < FastAvg and FastAvg < MedAvg and MedAvg < SlowAvg ;
if Condition2 and Condition2[1] = false then
Alert( "Bearish alert" ) ;
end ;
end ;
end ;
tbalanco is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Moving Average Label for Tradestation tbalanco Trading Indicators 0 09-28-2011 04:48 PM
Moving Average with Extension Tams Trading Indicators 2 02-27-2011 05:04 PM
Moving Average for Day Trading rxs0005 Technical Analysis 5 07-18-2010 06:23 PM
Adaptive Moving Average (AMA) metalhead Technical Analysis 38 07-03-2009 08:33 PM
Volume Moving Average mister ed Technical Analysis 3 11-09-2008 06:43 AM

All times are GMT -4. The time now is 10:00 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.