• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pivot Boss CandleStick Indicators VBA to NinjaTrader

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Pivot Boss CandleStick Indicators VBA to NinjaTrader

    Hello,

    I was wondering if the community would provide guidance for code conversion.
    I'm new to NinjaTrader ( Previous TradeStation EL) and wanting to learn how to program for it.

    Reading the book Secrets of a Pivot Boss, Frank Ochoa. (It's a good book and worth looking at) he provides code at in the Appendix but it's VBA. I've seen his pivot code out on the internet but not for his Candlestick code. I know and use NinjaTrader's candlestick indicators but I think turning his code into indicators this will help consolidate them.

    I'm putting them up here in hopes that they can be converted so that I can see how it's done or the community can point me in the right direction that I can convert myself.

    Conversion right now feels like a foreign language to me.

    Wick Reversal System

    #System
    #PARAM "Wick_Multiplier", 2.5, .5, 20
    #PARAM "Body_Percentage", .25, .1, 1

    If C>O
    AND (O - L) >= ((C - O)) * Wick_Multiplier) _
    AND (H - C) <= ((H - L)) * Body_Percentage) _
    or C<O
    AND (C - L) >= ((O - C) * Wick_Multiplier) _
    AND(H - L) <= ((H - L) * Body_Percentage) _
    or C = O AND NOT C = H _
    AND (H - L) >= ((H - C) * Wick_Multiplier) _
    AND (H - C <= ((H - L) * Body_Percentage) _
    or O = H AND C = H
    AND H - L >= AVG(H-L, 50) Then
    Signal = LongSignal

    Else C < O_
    AND (H - O) >= ((O - C) * Wick_Multiplier) _
    AND (C - L) <= ((H - L) * Body_Percentage) _
    OR C > O
    AND (H - C) >= ((C - O) * Wick_Multiplier) _
    AND (C - L) <= ((H - L) * Body_Percentage) _
    OR C = O AND NOT C = L
    AND (H - L) >= ((C - L) * Wick_Multiplier) _
    AND (C - L) <= ((H - L) * Body_Percentage) _
    OR O - L AND C = L
    AND O = L AND C = L
    AND H - L >= AVG(H-L, 50) Then
    Signal = ShortSignal

    End If

    Extreme Reversal System
    #PARAM “Bodysize”, .525, .05, 1
    #PARAM “BarsBack”, 50, 1, 50
    #PARAM “BodyMultiplier”, 2, .25, 5

    Dim Averagebody As Single
    Dim myBodySize As Single
    Dim myCandleSize As Single
    Dim AverageCandle As Single

    MyBodySize = ABS (C – O)
    AverageBody = Average (myBodySize, BarsBack)
    myCandleSize = (H – L)
    AverageCandle = Average (myCandleSize, BarsBack)

    If ((O[1] – C[1]) >= (BodySize * (H[1] – L[1]))) AND _
    ((H[1] – L[1]) > (AverageCandle * BodyMultiplier)) AND _
    ((O[1] – C[1] > AverageBody) AND _
    (O > C) Then
    Signal = LongSignal

    ElseIf ((C[1] - O[1]) >= BodySize * (H[1] – L[1])) AND _
    ((C[1] – O[1]) > AverageBody) AND _
    (O > C) Then
    Signal = ShortSignal

    End if

    Outside Reversal System

    #System
    #PARAM “BarMultiplier”, 1.25, .05, 3.5
    #PARAM “BarsBack”, 50, 1, 250

    Dim AverageCandle As Single
    Dim MyCandleSize As Single

    MyCandleSize = (H- L)
    AverageCandle = Average (myCandleSize, BarsBack)

    If L < L[1] AND C> H[1] AND
    ((H – L) >= (AverageCanlde * BarsMultiplier)) Then
    Signal = LongSignal

    Else H > H[1] AND C < L[1] AND _
    ((H – L) >= (AverageCandle * BarMultiplier)) Then
    Signal = ShortSignal

    End If


    Doji Reversal System

    #System

    #PARAM “Percentage”, .10

    Dim fRangeHL As Single
    Dim fRangeCO As Single

    fRangeHL = H[1] - L[1]
    fRangeCO = ABS(C[1] - O[1])

    If fRangeCO <= fRangeHL * Percentage _
    AND C < L[1] _
    AND L[1] > SMA(10) _
    AND C < O _
    Or C < L[2] AND NOT C[1] < L[2] _
    AND fRangeCO[1] <= fRangeHL[1] * Percentage _
    AND C < O _
    AND L[2] > SMA(10) Then
    Signal = ShortSignal

    ElseIf fRangeCO <= fRangeHL * Percentage _
    AND C > H[1] _
    AND H[1] < SMA(10) _
    AND C > O _
    OR C > H[2} AND NOT C[1] > H[2] _
    And fRangeCO[1] <= fRangeHL[1] * Percentage _
    AND C > O _
    AND H[2] < SMA(10) Then
    Signal = LongSignal

    End If


    Thank you
    Brett

    If anybody has any questions, I have the book so that I can reference the questions.
    Attached Files
    Last edited by bjames; 08-13-2016, 10:01 PM. Reason: update

    #2
    Hello,
    Unfortunately our support team would be unable to convert this indicator for you as we do not offer such services. We do have partners that would be able to program this for you or convert it for you. If you would like more information on them please let us know and I can have our partner affiliate contact you with more information.
    We will leave this thread open as well in case a member of the forum would like to convert this for you.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cody~ I wish this was something I knew.
      I'm in the process of learning how to use C#, but this is something I don't really know where to look.
      Last edited by bjames; 08-15-2016, 08:12 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sun0781, Today, 05:02 PM
      0 responses
      6 views
      0 likes
      Last Post sun0781
      by sun0781
       
      Started by ronhb107, 09-12-2019, 10:09 AM
      4 responses
      41 views
      0 likes
      Last Post Mr.Trader  
      Started by rwilliam, Today, 03:55 PM
      0 responses
      3 views
      0 likes
      Last Post rwilliam  
      Started by asmmbillah, Today, 03:42 PM
      2 responses
      7 views
      0 likes
      Last Post asmmbillah  
      Started by NT-Roland, Today, 03:25 PM
      0 responses
      7 views
      0 likes
      Last Post NT-Roland  
      Working...
      X