Convert TS price dsitribution to work on multicharts, ninja, or OEC?

Discussion in 'Trading Software' started by jtnet, Oct 31, 2009.

  1. jtnet

    jtnet

    possible?

    { This study plots the basic ActivityBar, together with a value area zone based on
    standard deviations around the ActivityBar's mode price. }

    inputs:
    ApproxNumRows( 10 ), { approx number of rows in each activity bar }
    CycleColors( true ), { The CycleColors input determines whether the color of
    cells is varied from one cell group to the next. This input has effect only
    when this study is applied to chart in which Data1 is daily or minute bars and
    when the hidden ActivityData is in minute bars. In all other cases, CycleColors
    is ignored - the cells are drawn in the color specified by the DefaultColor
    input. }
    DefaultColor( DarkGreen ),
    ModeType( -1 ), { 1= highest mode, -1 = lowest mode - see inline documentation in
    function AB_Mode for more information on this input }
    ZoneNumDevs( 1 ) ; { number of std devs on each side of mode price to be included
    in the AB Zone }

    variables:
    CellGroupColor( 0 ),
    MinuteInterval( BarInterval of ActivityData ),
    CellGroupLabel( "" ),
    oModeCount( 0 ),
    oModePrice( 0 ),
    SDev( 0 ),
    ZoneHi( 0 ),
    ZoneLo( 0 ) ;

    AB_SetRowHeight( AB_RowHeightCalc( ApproxNumRows, 3 ) ) ;

    if CycleColors then
    CellGroupColor = AB_NextColor( MinuteInterval ) of ActivityData
    else
    CellGroupColor = DefaultColor ;

    if CellGroupColor = GetBackGroundColor then
    CellGroupColor = DefaultColor ;

    CellGroupLabel = AB_NextLabel( MinuteInterval ) of ActivityData ;

    Value1 = AB_AddCellRange( High of ActivityData, Low of ActivityData, RightSide,
    CellGroupLabel, CellGroupColor, 0 ) ;

    Value2 = AB_Mode( RightSide, ModeType, oModeCount, oModePrice ) ;
    SDev = AB_StdDev( ZoneNumDevs, RightSide ) ;
    ZoneHi = MinList( AB_High, oModePrice + SDev ) ;
    if ZoneHi = 0 then { ie, if oModePrice + SDev = 0 }
    ZoneHi = AB_High ;
    ZoneLo = MaxList( AB_Low, oModePrice - SDev ) ;
    { if oModePrice - SDev = 0 then ZoneLo = Low, so don't need a check here }

    AB_SetZone( ZoneHi, ZoneLo, RightSide ) ;


    { ** Copyright (c) 2007 TradeStation Technologies, Inc. All rights reserved. **
    ** TradeStation reserves the right to modify or overwrite this analysis technique
    with each release. ** }