Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get price level for limit order

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

    How to get price level for limit order

    I have an indicator that plots a level on the chart. I would like to know how I can pull the price level for use as an entry by limit order.

    So for example if price crosses below the 8 SMA, I want the price of the high of the bar that crossed below the 8 SMA so that I may enter by long limit order.

    Thanks.

    #2
    Hello brucelevy,

    Thanks for your post.

    With the example of price crossing below an 8 period EMA and wanting to place an order at the high of the bar where the price crossed you would need to use either a stop or stoplimit as you would be wanting to go long above the current price. Here is an example:

    if (CrossBelow(Close, EMA(8), 1)
    {
    EnterLongStop (1, High[0]);
    }

    Comment


      #3
      OK great, how can I go about storing that price level for later use?

      Comment


        #4
        Hello brucelevy,

        Thanks for your reply.

        To store that value for later use, you would need to declare a double variable in the region variables and then in the code some thing like:

        if (CrossBelow(Close, EMA(8), 1)
        {
        EnterLongStop (1, High[0]);
        mySavedHigh = High[0]; // save value for later use.
        }

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        155 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        137 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X