I searched through some of my old disk drives from a few years back and
came across the Insync code I had for TradeStation.  I had originally
paid Samuel Tennyson to write this for me in terms of TradeStation.
Insync is a consensus indicator and some may find it of use.
I have included the TradeStation code for this below and perhaps someone
here might code it up in AFL and put it in our library.   I also found
the original reference to Insync in Technical analysis of Stocks and
Commodities as well as some MetaStock code.
Stocks and Commodities
<http://store.traders.com/-v13-c01-insync-pdf.html>

MetaStock
<http://www.equis.com/customer/resources/formulas/formula.aspx?Id=27>


Comments are enclosed with {}
_______________________________________________Insync code for
TradeStation:_______________________________________________
{

Threshold type       Periods    Pre -Sell   
-Buy-----------------------------------mfi        14            80     
20bollb      20            95       5fastd      14            80     
20fastk      14            85      15rsi        14            75     
30cci        14          +100    -100
Moving Average type       Periods         Sell    
Buy-----------------------------------roc        10            10     
10       Averageeom        13            10      10       Averagemacd   
12/25             9       9       Averagepdo        18            10
10       xAverage

}
Inputs: PreBuy (Numeric), PreSel (Numeric) ;
Vars  : xinsync(0), BollB     (0) ;Vars  : eom     (0), vrt.m.f.i (0) ;
xinsync= 50 ;
Value1 = StdDev (Close,  20) * 2.0 ;if (2 * Value1 <> 0) then  BollB =
((Close + Value1 - Average (Close,  20)) /               (2 * Value1)) *
100.0 ;
EOM = vrt.Ease.Of.Movement (13) * 100000 ;vrt.M.F.I =
vrt.Money.Flow.Index (Close, 14) ;
{ Pre Sell  }
if (vrt.M.F.I       >   60) then xinsync= xinsync+  5.0 ;if (BollB
>   95) then xinsync= xinsync+  5.0 ;if (CCI        (14) > +100) then
xinsync= xinsync+  5.0 ;if (FastD      (14) >   80) then xinsync=
xinsync+  5.0 ;if (FastK      (14) >   80) then xinsync= xinsync+  5.0
;if (RSI (Close, 14) >   65) then xinsync= xinsync+  5.0 ;
if (         (Close - XAverage (Close, 18)) -    XAverage (Close -
XAverage (Close, 18), 10) > 0) and   (XAverage (Close - XAverage (Close,
18), 10) > 0)                            then xinsync= xinsync+  5.0 ; {
pdo }
if (Average (MACD (Close, 12, 25), 9) > 0) and   (Average (MACD (Close,
12, 25), 9) <             MACD (Close, 12, 25))
then xinsync= xinsync+  5 ;
if (Average (RateOfChange (Close, 10), 10) > 0) and   (Average
(RateOfChange (Close, 10), 10) <             RateOfChange (Close, 10))
then xinsync= xinsync+  5 ;
if (Average (EOM, 10) >   0) and   (Average (EOM, 10) < EOM)
then xinsync= xinsync+  5 ;
{ Pre  Buy }
if (vrt.M.F.I       <   40) then xinsync= xinsync-  5.0 ;if (BollB
<    5) then xinsync= xinsync-  5.0 ;if (FastK      (14) <   20) then
xinsync= xinsync-  5.0 ;if (FastD      (14) <   20) then xinsync=
xinsync-  5.0 ;if (RSI (Close, 14) <   35) then xinsync= xinsync-  5.0
;if (CCI        (14) < -100) then xinsync= xinsync-  5.0 ;
if (         (Close - XAverage (Close, 18)) -    XAverage (Close -
XAverage (Close, 18), 10) < 0) and   (XAverage (Close - XAverage (Close,
18), 10) < 0)                            then xinsync= xinsync-  5.0 ;
if (Average (MACD (Close, 12, 25), 9) < 0) and   (Average (MACD (Close,
12, 25), 9) >             MACD (Close, 12, 25))
then xinsync= xinsync-  5.0 ;
if (Average (RateOfChange (Close, 10), 10) < 0) and   (Average
(RateOfChange (Close, 10), 10) >             RateOfChange (Close, 10))
then xinsync= xinsync-  5.0 ;
if (Average (EOM, 10) <   0) and   (Average (EOM, 10) > EOM)
then xinsync= xinsync-  5.0 ;{Plot1 (InSync, "InSync") ;Plot2 (PreBuy,
"PreBuy") ;Plot3 (PreSel, "PreSel") ;}{    This enables the Alert
feature of the Auto-Analyst for  all versions of SuperCharts and Version
3.5 of TradeStation.
if (InSync <= PreBuy) or   (InSync >= PreSel) then Alert = TRUE ;
     Do not forget to turn on the check box found in File,  Properties,
Alert.
     Here is an alternate syntax that might be more generic.
if (Plot1 <= Plot2) or   (Plot1 >= Plot3) then Alert = TRUE ;

if (Plot1 crosses above Plot2) then Alert = TRUE;}
{print (file("C:\insync"),xinsync:6:0);}insync = xinsync;
____________________________________________________
Insync usage as an
Indicator:____________________________________________________


Inputs: BuyZone(5), SellZone(95); Vars: BZColor(Green),
SZColor(Magenta);
Plot1(insync(BuyZone, SellZone), "Insync");Plot2(BuyZone,
"BuyZone");Plot3(SellZone, "SellZone");
If Plot1 >= SellZone then Begin Alert("The Insync is in overbought
territory");  SetPlotColor(1, SZColor);EndElse If Plot1 <= BuyZone then
Begin  Alert("The Insync is in oversold territory");  SetPlotColor(1,
BZColor);End;
____________________________________________________
Insync usage as a
System:____________________________________________________
Variables: mlt(3.7);
If CurrentBar = 1 then Begin  Print("");  Print("Symbol ",
GetSymbolName); End;
Value1 = InSyncl(5, 95);Value2 = 999999;
If (Value1[1] <= 5) and (Value1[0] > 5) Then Begin  print(date:6:0, "
open ", open, " atr ", (AvgTrueRange(20)),    " open + var + atr ",
open+(mlt * AvgTrueRange(20)),   " Open profit ", c - entryprice ); 
Buy("Insync") open today + (mlt * AvgTrueRange(20)) stop; end;
{If (Value1[1] <= 5) and (Value1[0] > 5) Then Begin  Value2 = Open;  
Buy("Insync+atr") ValBegin (.5 * AvgTrueRange(15)) Stop; End else Begin 
Value2 = 999999; end;}




Reply via email to