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