Grupp: Huvudforum

Programera i tradestation

0
Ogilla!
1
Gilla!
#0   Av: amma » Redigera
2005-12-05 09:04:44

Hej!

Är det någon som vet en bra hemsida med information om hur man gör enkla program i tradestation?

Är ute efter ett program som kan färga staplar beroende på om de stänger över eller under ett glidande medelvärden.

Tack på förhand!

0
Ogilla!
12
Gilla!
2005-12-05 09:23:46

Kolla koden här under, kommer 2 exempel på hur jag gjort.

*****************************

Written by: Fredrik Jensen

Description: Relative Strength Comparing whith Index. This will show if the Data is performing better than the market in general.

****************************************}

input:MA1(50), MA2(200);


Vars:    RS1(0),RS5(0),RS8(0),RS13(0),RS26(0),RS40(0),RS52(0) ,             {This is for Data 1}
        RS1C(0),RS5C(0),RS8C(0),RS13C(0),RS26C(0),RS40C(0),RS52C(0);    {This is for the comparing Data2}

Value10 = Close of data1;
Value11 = Close of data2;

{This is RS for Data 1}
RS1 =     IFF(Value10[5] <> 0, Value10/Value10[5],1);
RS5 =     IFF(Value10[25] <> 0, Value10/Value10[25],1);
RS8 =     IFF(Value10[40] <> 0, Value10/Value10[40],1);
RS13 =     IFF(Value10[65] <> 0, Value10/Value10[65],1);
RS26 =     IFF(Value10[130] <> 0, Value10/Value10[130],1);
RS40 =     IFF(Value10[200] <> 0, Value10/Value10[200],1);
RS52 =     IFF(Value10[255] <> 0, Value10/Value10[255],1);

{This is for the comparing index, Data 2}
RS1C = IFF(Value11[5] <> 0, Value11/Value11[5],1);
RS5C = IFF(Value11[25] <> 0, Value11/Value11[25],1);
RS8C = IFF(Value11[40] <> 0, Value11/Value11[40],1);
RS13C = IFF(Value11[65] <> 0, Value11/Value11[65],1);
RS26C = IFF(Value11[130] <> 0, Value11/Value11[130],1);
RS40C = IFF(Value11[200] <> 0, Value11/Value11[200],1);
RS52C = IFF(Value11[255] <> 0, Value11/Value11[255],1);

{This is for data 1}
value1 =     (2*(RS1+RS5+RS8+RS13)        {First RS Data1 weighted by 2}
        +     (RS26+RS40+RS52))/11;        {Second RS Data1 normal weight}

{This is For data2}
Value2 =     (2*(RS1C+RS5C+RS8C+RS13C)    {First RS Data2 weighted by 2}
        +     (RS26C+RS40C+RS52C))/11;    {Second RS Data2 normal weight}

{This is the calculated difference that we use to plot and Use for value3 and value4}
Value3 = IFF(Value2 <> 0, Value1/Value2,1);

{This is to show Average of the results when we compare Data1 and Data2}
value4 = wAverage(Value3,MA1);            {Weighted MA of the RS Data1 results}

value5 = wAverage(Value3,MA2);            {Weighted MA of the RS Data1 results}


{ This is the criteria that will trigger alert.}

Condition1 = Value4 > value5;         {Short average crosses over long average}
Condition2 = Value4 < Value5;        {Short average crosses under long average}
Condition3 = Value5 > Value5[1];    {The slope has to be up for the Long MA}

If Condition1 and Condition3 then
    
        Plot1(High,"RSCUp");
        Plot2(Low,"RSCUp");
    
{ Description of Alert}

If condition1 Then
    Alert("ShortMARSC crossing Over LongMARSC");

*****************************

****************************

{***************************************

Written by: Fredrik Jensen

Description: Paints bar green when AO and AC both are green and Paints bar Red when both are red.

****************************************}



Input: LA1(34), LA2(5);

Vars:MA1(0),MA2(0),AO(0),AC(0),SMA5(0);

MA1=Average((H+L)/2,LA1);

MA2=Average((H+L)/2,LA2);

{*** Awesome Oscillator***}
AO=MA2-MA1;

SMA5=Average(AO,LA2);
{*** Acceleration/Decelerationr***}
AC=Average((AO-SMA5),LA2);


Condition1 = AO>=AO[1] and AC>=AC[1];

Condition2 = AO<=AO[1] and AC<=AC[1];


If Condition1 Then Begin

    PlotPaintBar(High, Low, "GR");

    If Condition1 Then
        SetPlotColor(1, Green)
    Else
        If Condition2 Then
            SetPlotColor(1, Red);
    

End;

If Condition2 Then Begin

    PlotPaintBar(High, Low, "GR");

    If Condition1 Then
        SetPlotColor(1, Green)
    Else
        If Condition2 Then
            SetPlotColor(1, Red);
    

End;

***************************** 

MVH
Piraya
Fredrik Jensen
http://www.stockletter.se

0
Ogilla!
12
Gilla!
2005-12-05 09:28:35

för över ma :

input: xLen(34);

IF close > Average(c,xLen) Then
    PlotPaintBar(High, Low, "Close > Avg");

för under ma:

input: xLen(34);

IF close < Average(c,xLen) Then
    PlotPaintBar(High, Low, "Close < Avg");

lägg dom bara i två separata paintbarstudies.

mvh PQ..

 

0
Ogilla!
2
Gilla!
2005-12-05 09:46:42

Många tack!

Vet ni om det finns någon hemsida där man kan lära sig grunderna och se enkla program.

Tack än en gång!

0
Ogilla!
2
Gilla!
2005-12-05 11:42:08

Ett riktigt stor tack! Verkligen! Ni hjälpte mig lösa mitt problem!

om man skriver average eller avg, så blir det ett simpelt moving average, vet ni hur man gör om man vill ha ett exponentiellt moving average i stället?

vh,

amma

0
Ogilla!
6
Gilla!
2005-12-05 11:51:50

xaverage = expo 

0
Ogilla!
1
Gilla!
2005-12-05 11:54:11

du är en klippa!

:)

0
Ogilla!
0
Gilla!
2005-12-05 15:41:14

Jo, för ett antal år sen så var det tack vare Börsdata genom Piraya´s bokrekar som fick en att läsa alla de bästa böckerna för att sen ansluta till AG. Så han är väl en legend vid det här laget :)

mvh
Daytradern.com
- Improves your social mood -

0
Ogilla!
0
Gilla!
2005-12-06 10:24:55

om det är någon som söker bland inläggen i framtiden.

hittade en bok om easylanguage man kan ladda ner.

https://www.tradestation.com/support/books/pdf/EL_Getting_Started.pdf

"Getting Started with EasyLanguage®

Here's the book you need if you're thinking about using EasyLanguage but don't know where to start. With a user-friendly writing style, the book assumes no prior programming experience, but credits the reader with the ability to apply logical thinking to the processing of trading concepts."

Upp till toppen
Kommentera

 

Tjäna mer pengar på dina aktieaffärer

Bli medlem på Aktieguiden gratis på 30 sekunder.

Som medlem på Aktieguiden kan du:

  • Läsa träffsäkra tips och analyser från duktiga traders
  • Ställa frågor till och chatta med aktieproffs
  • Få gratis tillgång till en över miljon inlägg aktiehandel
  • Skapa egna privata forumgrupper

För att få delta i diskussionerna på Aktieguiden krävs att du verifierar ditt mobilnummer. Läs gärna mer om varför verifiering behövs.

 

Redan medlem? Klicka här för att logga in.