Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BuySellPressure fails to read

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

    BuySellPressure fails to read

    Hi,

    I have a strategy running in which I want to use Buy and Sell Pressure.

    However, the strategy fails to read it. It always indicates 50/50 whereas I see
    on the chart the percentages are not 50/50

    This is the code:
    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    BuySellPressure().CalculateOnBarClose = false;
    }

    protected override void OnBarUpdate()
    {

    if (Historical)
    return;

    //debug
    Print(Instrument.FullName.ToString() + " " + Time[0].ToString() + " BUYP " + BuySellPressure().SellPressure[0].ToString() + " SELLP " + BuySellPressure().BuyPressure[0].ToString()
    + " PREV BUYP " + BuySellPressure().SellPressure[1].ToString() + " PREV SELLP " + BuySellPressure().BuyPressure[0].ToString());

    }

    This is the output: (everytime 50/50)
    ES 12-15 10/12/2015 7:15:38 AM BUYP 50 SELLP 50 PREV BUYP 50 PREV SELLP 50
    CL 11-15 10/12/2015 7:15:58 AM BUYP 50 SELLP 50 PREV BUYP 50 PREV SELLP 50
    ES 12-15 10/12/2015 7:16:16 AM BUYP 50 SELLP 50 PREV BUYP 50 PREV SELLP 50
    M6A 12-15 10/12/2015 7:16:18 AM BUYP 50 SELLP 50 PREV BUYP 50 PREV SELLP 50
    ES 12-15 10/12/2015 7:16:28 AM BUYP 50 SELLP 50 PREV BUYP 50 PREV SELLP 50

    Does anyone have an idea what I'm doing wrong ?

    #2
    Update: I put the code BuySellPressure().CalculateOnBarClose = false;
    in OnBarUpdate() iso Initialize() (like the NT7 programming guide suggest), and that seems to work

    Comment


      #3
      Hello,

      Thank you for the reply.

      I wanted to check, you said this is resolved by placing BuySellPressure().CalculateOnBarClose = false; in the Initialize but see this was in your original example.

      I just wanted to verify was this resolved by using this as you have?

      If not please let me know and we can continue to look into the code.

      I look forward to being of further assistance.

      Comment


        #4
        Yes it is resolved now.

        Putting "BuySellPressure().CalculateOnBarClose = false" in Initialize() does not work.

        But "BuySellPressure().CalculateOnBarClose = false" in OnBarUpdate() does work.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        55 views
        0 likes
        Last Post CarlTrading  
        Working...
        X