TradersStudio , Traders Tips.

Quote from Gyles:

Do you have any plans to add a resource where TradersStudio users can share the code which they have written?

If people would like to submit code, they can send it to

Murray@TradersStudio.com and I will make it available after reviewing it.
 
Quote from Derrick1983:

I have heard that one can translate TradeStation code into TradersStudio code. Is it possible to show some examples?

It is possible and shall show you some examples in a day or so.
 
As promised to you Derrick1983, the following is the first example:

Please note that the original TradeStation code translated can be seen at http://www.tssupport.com/support/base/?action=article&id=1370

Code:
Function TROUGHDIVERGENCE(STRENGTH, OSC As BarArray) As BarArray

                Dim IC As BarArray
                Dim IH As BarArray
                Dim IP As BarArray
                Dim IL As BarArray
                Dim LC As BarArray
                Dim LP As BarArray
                Dim LH As BarArray
                Dim LL As BarArray
                Dim VALUE1 As BarArray
                Dim VALUE2 As BarArray
                Dim VALUE3 As BarArray
                Dim VALUE4 As BarArray
                Dim VALUE5 As BarArray

                If BarNumber=FirstBar Then
                                IC = 0
                                IH = 0
                                IP = 0
                                IL = 0
                                LC = 0
                                LP = 0
                                LH = 0
                                LL = 0
                                VALUE1 = 0
                                VALUE2 = 0
                                VALUE3 = 0
                                VALUE4 = 0
                                VALUE5 = 0
                End If
 
                VALUE1=SWINGLOW(1,LOW,STRENGTH,STRENGTH+1)

                If VALUE1<>-1 Then
                                LP=LC
                                LC=VALUE1
                                IP=IC
                                IC=OSC[STRENGTH]
                                LH=VALUE2
                                LL=VALUE3
                                VALUE2=Highest(LOW, STRENGTH+1, 0)
                                VALUE3=Lowest(LOW, STRENGTH+1, 0)
                                IH=VALUE4
                                IL=VALUE5
                                VALUE4=Highest(OSC, STRENGTH+1, 0)
                                VALUE5=Lowest(OSC, STRENGTH+1, 0)
                End If

                If LOW>VALUE2 Then
                                VALUE2=LOW
                End If

                If LOW Then
                                VALUE3=LOW
                End If

                If OSC>VALUE4 Then
                                VALUE4=OSC
                End If

                If OSC Then
                                VALUE5=OSC
                End If

                If (LH-LL)=0 OR (IH-IL)=0 Then
                                TROUGHDIVERGENCE=TROUGHDIVERGENCE[1]
                Else
                                TROUGHDIVERGENCE=50*(((IC-IP)/(IH-IL))-((LC-LP)/(LH-LL)))
                End If

End Function


Please let me know if you have any queries?
 
Back
Top