• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pip Math

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

    Pip Math

    When I'm performing math to adjust stops in Forex, do I have to convert the price to a double and determine if its x.xx. or x.xxxx or is there a built in function for this?

    Example: I want to compare the current close to the average price plus a # of pips ...

    If (Close[1] > AveragePrice + 25 pips)

    Thanks in advance!!

    #2
    Hello RiversideDude,

    Thank you for your note.

    You would want to multiple the amount of pips/ticks by TickSize, which will leave you with the correct format for the decimal.

    For example,

    Code:
    if(Close[1] > AveragePrice +25*TickSize);
    I would encourage you to add prints and pull up a output window to check values, for example,

    Code:
    Print((Close[0]+2*TickSize).ToString());
    See TickSize section of our helpguide,
    http://ninjatrader.com/support/helpG...t_ticksize.htm

    I would also see RoundToTickSize section of our helpguide,
    http://ninjatrader.com/support/helpG...toticksize.htm

    RoundDownToTickSize(),
    http://ninjatrader.com/support/helpG...toticksize.htm

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by dyanemorye, Today, 01:45 AM
    0 responses
    2 views
    0 likes
    Last Post dyanemorye  
    Started by Bouzayen, Yesterday, 08:31 PM
    0 responses
    16 views
    0 likes
    Last Post Bouzayen  
    Started by IanC28, 03-27-2020, 10:20 AM
    6 responses
    32 views
    0 likes
    Last Post jim1234
    by jim1234
     
    Started by aramtrader, 04-01-2020, 03:05 PM
    7 responses
    44 views
    0 likes
    Last Post woodie1
    by woodie1
     
    Started by renehtx, Yesterday, 03:51 PM
    2 responses
    20 views
    0 likes
    Last Post renehtx
    by renehtx
     
    Working...
    X