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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X