[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GT] recursive object aliases



In SVN Commit r637 on the exp branch, I have fixed the problem of object aliases not being recursive. I have since found that object aliases are very useful... they allow to build up complex portions of a GT run in simple, reusable ways.

 

For example, put this into your aliases/signal file:

 

3Xoverlong {S:Generic:Or

   {S:Generic:And {S:Generic:Above #1 #3} {S:Generic:CrossOverUp #2 #3}} 

   {S:Generic:And {S:Generic:Above #2 #3} {S:Generic:CrossOverUp #1 #3}}}

3Xovershort  {S:Generic:Or 

   {S:Generic:And {S:Generic:Below #1 #3} {S:Generic:CrossOverDown #2 #3}} 

   {S:Generic:And {S:Generic:Below #2 #3} {S:Generic:CrossOverDown #1 #3}}}

 

3EMAlong    {
AT
S:3Xoverlong {I:EMA #1} {I:EMA #2} {I:EMA #3}}

3EMAshort   {
AT
S:3Xovershort {I:EMA #1} {I:EMA #2} {I:EMA #3}}

 

You can see how 

  - 3Xoverlong is a generic crossover signal involving three lines

  - using this we define 3EMAlong as a crossover signal involving three EMA

  - and then I could define a SY from two such crossover signals

 

3EMA {
AT
S:3EMAlong 60 90 120} {
AT
S:3EMAshort 60 90 120}

 

Note that we can define many more signals conveniently based on these.

 

I have rewritten many of my previously defined systems, signals, and indicators in a much more modular and reusable form using object aliases in this manner. I highly recommend doing the same (of course, you need to apply above commit or use the experimental branch.

 

Th.