I ran the following code with the futures (Cocoa) and fx (EURUSD) (see attached files).
The futures had results but the fx didn't return anything although graphically, there will be bars that trigger results for both.
Does that fact that fx uses "mid" rather than "close" affect the results?
Public Class MySymbolScript
Private sma50 As New SMA(50)
Private sma100 As New SMA(100)
Private ATR As New AverageTrueRange(14)
Private highest55 As New Highest(55)
Public Overloads Overrides Sub Startup()
' Perform initialization here
Public Overloads Overrides Sub NewBar()
' Put your trading code here
If lastclose.Current >= highest55.Current AndAlso sma50.LookBack(0) > sma100.LookBack(0) Then
Public Overloads Overrides Sub OrderFilled(ByVal position As Position, ByVal trade As Trade)
' This method is called when an order is filled
' Check if this is the entry trade for a position
Public Overloads Overrides Sub OrderCancelled(ByVal position As Position, ByVal order As Order, ByVal information As String)
' This method is called when an order is cancelled or rejected
If Not order.CancelPending Then
OutputWarning("Unexpected order cancel: " & order.ToString() & " " & information)