Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

Hi,

 

Would anyone be kind enough to convert the following Tradestation code

for a 9 5 Count into Metastock Code as an indicator?

 

inputs:

BackLen(4),

FirstCount(5),

SecondCount(9),

UpPrice(Close),

DnPrice(Close),

ShowText( true ),

TextColor( White );

 

variables:

CountUp( 0 ),

CountDn( 0 ),

TextID( 0 ) ;

if UpPrice < UpPrice[backLen] then CountUp = 0;

if UpPrice > UpPrice[backLen] then

begin

CountUp = CountUp + 1 ;

if CountUp = FirstCount then

begin

Plot1( H, "5 Sell" ) ;

Alert ;

if ShowText then

begin

TextID = Text_New( Date, Time, High+(H*.001), NumToStr( CountUp, 0 ) ) ;

Text_SetStyle( TextID, 2, 1 ) ;

Text_SetColor( TextID, TextColor ) ;

end ;

end ;

if CountUp = SecondCount then

begin

Plot2( H, "9 Sell" ) ;

Alert ;

if ShowText then

begin

TextID = Text_New( Date, Time, High+(H*.001), NumToStr( CountUp, 0 ) ) ;

Text_SetStyle( TextID, 2, 1) ;

Text_SetColor( TextID, TextColor ) ;

end ;

end ;

end;

if DnPrice > DnPrice[backLen] then CountDn = 0;

if DnPrice < DnPrice[backLen] then

begin

CountDn = CountDn + 1 ;

if CountDn = FirstCount then

begin

Plot3( L, "5 Buy" ) ;

Alert ;

if ShowText then

begin

TextID = Text_New( Date, Time, Low-(Low*.001), NumToStr( CountDn, 0 ) ) ;

Text_SetStyle( TextID, 2, 0 ) ;

Text_SetColor( TextID, TextColor ) ;

end ;

end ;

if Countdn = SecondCount then

begin

Plot4( L, "9 Buy" ) ;

Alert ;

if ShowText then

begin

TextID = Text_New( Date, Time, Low-(Low*.001), NumToStr( Countdn, 0 ) ) ;

Text_SetStyle( TextID, 2, 0) ;

Text_SetColor( TextID, TextColor ) ;

end ;

end ;

end;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...