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 algospoke, Yesterday, 06:40 PM
      2 responses
      19 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      20 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X