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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        28 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        284 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        281 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        132 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        90 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X