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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        56 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X