Register Login
Forums    February 9, 2012
TradersStudio Forums
Consecutive up or down SMA days
Last Post 02-02-2010 06:13 PM by mur ang. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
steven chen
New Member
New Member
Posts:5

--
02-02-2010 08:44 AM
    Just activated TS2.5 and still very new. Here is my question:
    I can create a 100day SMA barArray, then I want to compare every day's 100-day SMA vs that of prior day. bar. Is there a built-in function or code to capture UP or Down consecutive N-day (i.e. 5-day). This variable can decide if going long or short. Thanks.
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    02-02-2010 06:13 PM
    Make Maxbars back greater than 101.

    Dim Count
    Dim LowCt
    Dim SA as bararray
    SA=Average(Close,100,0)
    LowCT=0
    for count=0 to 100
    if SA[count]LowCT=LowCT+1
    end if
    next
    You are not authorized to post a reply.


     TradersStudio, Inc. ® Copyright 2004-2012 All Rights Reserved   Terms Of Use  Privacy Statement