Market Trader Forum

Market Trader Forum
das ultimative Expertenforum
 
RegistrierenRegistrieren  LoginLogin

Neues Thema eröffnen   Neue Antwort erstellen    Market Trader Forum Foren-Übersicht -> TradeStation Ecke
Autor
Nachricht
wp


Anmeldedatum: 29.08.2005
Beiträge: 388

Stacktrade
Verfasst am: 20.10.2007, 14:56

Hier meine Replica, einzig die Farberkennung von dem mittleren Band stimmt noch nicht, da sie aber keine Rolle bei den Setups spielt, bin ich zu faul da noch zu ermitteln:

Für Ind:

<pre>
input:
Price(AvgPrice),lengthSR(25),LengthSt1(20), TrigAvg(5), LengthThick(35),
upColor1(cyan),dnColor1(magenta),UpColor(blue), DnColor(red);
vars:
it(0);

//SR_Line
it = VWAP_SMA(Price,lengthSR);

plot1(it,"SR_Line ");

if plot1 > plot1[ 1 ] then setplotcolor(1,upColor1);
if plot1 < plot1[ 1 ] then setplotcolor(1,dnColor1);


//Stack
value1 = TimeSeriesForecast (LengthSt1, 0);
value2 = XAverage (value1, TrigAvg) ;
Plot2 (value1, "Stack1");
Plot3 (value2, "Stack2");

IF (value2 >= value1) THEN
BEGIN
SETPLOTCOLOR (2, DnColor) ;
SETPLOTCOLOR (3, DnColor) ;
END ELSE
BEGIN
SETPLOTCOLOR (2, UpColor) ;
SETPLOTCOLOR (3, UpColor) ;
END ;

//Thick
value3 = TimeSeriesForecast (LengthThick, 0);
value4 = XAverage (value3, TrigAvg) ;

Plot4 (value4, "Thick");
IF (value4 >= value3) THEN
BEGIN
SETPLOTCOLOR (4, DnColor) ;

END ELSE
BEGIN
SETPLOTCOLOR (4, UpColor) ;
END ;
SetPlotWidth(4, 4);

</pre>

und Paintbar
<pre>

[LegacyColorValue = true];

{ VWAP MA }
input:
Price(AvgPrice),length(25),upColor(cyan),dnColor(red);
vars:
it(0);

it = VWAP_SMA(Price,length);

if( L > it ) then
begin
PlotPB(High, Low, Open, Close, "SR-Line", Green );
end
else if( H < it ) then
begin
PlotPB(High, Low, Open, Close, "SR-Line", Red );
end
else
begin
PlotPB(High, Low, Open, Close, "SR-Line", White );
end;

</pre>

Sieht dann so aus, oben Replica unten Orginal.

<img src="http://www.boersentrendonline.de/upload/REP.jpg">
_________________


Zuletzt bearbeitet von wp am 25.02.2009, 16:43, insgesamt 2-mal bearbeitet
 
wegi


Anmeldedatum: 14.04.2007
Beiträge: 218
Wohnort: Bayern


Verfasst am: 28.10.2007, 09:42

@WP

Sind die Funktionen:
- TimeSeriesforecast
- vwap_sma

Tradestation-Funktionen ?

Könntest du die auch bitte posten ?

 
wp


Anmeldedatum: 29.08.2005
Beiträge: 388


Verfasst am: 28.10.2007, 16:43

VWAP_SMA

 { VWAP SMA }

input:
Price(NumericSeries),length(NumericSimple);
vars:
PV( 0),
Vol( 0),
dayBar1( 0),
len( 0),
it( 0);

if date <> date[ 1 ] then
dayBar1 = barNumber;

len = MinList(BarNumber-dayBar1,length);

PV = price * Ticks;
Vol = Ticks;

value1 = summation(Vol,len);
if value1 <> 0 then
it=summation(PV,len)/value1
else
it=Price;
VWAP_SMA = it;



mit Funktion Summation
inputs: Price( numericseries ), Length( numericsimple ) ;
variables: Sum( 0 ) ;

Sum = 0 ;

for Value1 = 0 to Length - 1
begin
Sum = Sum + Price[Value1] ;
end ;

Summation = Sum ;


und


inputs: Length( numericsimple ), TgtBar( numericsimple ) ;
variables: oLRSlope( 0 ), oLRAngle( 0 ), oLRIntercept( 0 ), oLRValue( 0 ) ;

Value1 = LinearReg( C, Length, TgtBar, oLRSlope, oLRAngle, oLRIntercept, oLRValue ) ;

TimeSeriesForecast = oLRValue ;

mit Funktion LinearReg

{ Linear Regression multiple-output function; see MULTIPLE-OUTPUT FUNCTIONS note
below }

inputs:
Price( numericseries ),
Length( numericsimple ), { Length > 1 }
TgtBar( numericsimple ), { use negative integer for future, positive for past }
oLRSlope( numericref ),
oLRAngle( numericref ),
oLRIntercept( numericref ), { left intercept, at vertical through
Price[ Length - 1 ] }
oLRValue( numericref ) ;

variables:
SumXY( 0 ),
SumY( 0 ),
SumX( 0 ),
SumXSqr( 0 ),
OneSixth( 1 / 6 ),
Divisor( 0 ) ;

if Length > 1 then
begin
SumX = Length * ( Length - 1 ) * .5 ;
SumXSqr = Length * ( Length - 1 ) * ( 2 * Length - 1 ) * OneSixth ;
Divisor = Square( SumX ) - Length * SumXSqr ;
SumXY = 0;
for Value1 = 0 to Length - 1
begin
SumXY = SumXY + Value1 * Price[Value1] ;
end ;
SumY = Summation( Price, Length ) ;

oLRSlope = ( Length * SumXY - SumX * SumY) / Divisor ;
oLRAngle = ArcTangent( oLRSlope ) ;
oLRIntercept = ( SumY - oLRSlope * SumX ) / Length ;
oLRValue = oLRIntercept + oLRSlope * ( Length - 1 + ExecOffset - TgtBar ) ;
LinearReg = 1 ;
end
else
LinearReg = -1 ;


_________________


 
Neues Thema eröffnen   Neue Antwort erstellen    Market Trader Forum Foren-Übersicht -> TradeStation Ecke

Tags: length, stacktrade, vwap

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge 5 Minuten Close MT-ACD 549 10.02.2006, 11:47
Keine neuen Beiträge BuFu Settlement und Close. Was machen wir damit? 925 21.12.2005, 15:30
Keine neuen Beiträge Open und ReffOpen 482 25.10.2005, 20:06
Keine neuen Beiträge Open/Close VA 547 14.10.2005, 10:59
Keine neuen Beiträge Open/Close Handelssystem (@Bueschl) 635 28.09.2005, 15:07
 



[ Time: 0.1735s ][ Queries: 119 (0.0147s) ][ GZIP on - Debug on ]