Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using OnMarketData in strategy entry logic

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

    Using OnMarketData in strategy entry logic

    I would like to reference the e.Volume as part of my strategy logic.

    i.e., if e.volume > x go long

    How can I have the onbarupdate read the onmarketdata e.volume?

    Thanks.

    #2
    Hello brucelevy,

    Thank you for your post.

    You would store it in a double and then call that double in OnBarUpdate. For example:

    In OnMarketData:
    Code:
    myDouble = e.Volume;
    In OnBarUpdate:
    Code:
    if (myDouble > myComparisonValue)
    EnterLong();

    Comment


      #3
      I've added it in but when I run the script I get an error that my computer has run out of memory. NT is the only platform running and I have a sufficient amount of memory installed.

      Comment


        #4
        Hello brucelevy,

        Thank you for your response.

        Please send us your log and trace files so we may investigate this matter further. You can do this by going to the Control Center-> Help-> Mail to Platform Support. Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

        Please list 'ATTN: Patrick H - 1552628' in the subject line.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        36 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        23 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        96 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        152 views
        2 likes
        Last Post CaptainJack  
        Working...
        X