Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to translate this line of pseudocode to C#

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

    How to translate this line of pseudocode to C#

    Hello ninjatrader community,

    I would like to know how I can translate this into c#:

    if (GetCurrentAsk(1) is greater than open[0] by 1 point)
    EnterLong();


    #2
    Hello Don22Trader1,

    Thank you for your post.

    For an instrument with a tick size of .25, the following would compare the current ask of the primary data series to the Open price + 1 point (4 ticks):


    Code:
    if (GetCurrentAsk(0) >= (Open[0] + (4 * TickSize)) )
    {
    EnterLong();
    }
    If you're using multiple series in the script, GetCurrentAsk(1) would return the current ask price of the first added data series in the script. You'd want to use Opens[0][0] to compare that to the primary series' bar open price or Opens[1][0] to compare to the secondary series bar open price.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    53 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X