• 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

Calculate Distance

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

    Calculate Distance

    Hi!
    Using the strategy builder:

    is there a way to calculate the distance between price (open) and EMA?
    i'd like to use it for an entry condition:
    something like "distance from price to EMA" needs to be smaller than "x".

    any other way to calculate will also be fine!
    anybody any ideas ?
    thank you


    #2
    Hello Tradexxx,

    Thanks for your post.

    The Strategy Builder does have some functionality for creating mathematical offsets, however more intuitive and robust solutions can be programmed by hand.

    In the Builder, I would suggest using separate conditions to consider cases when the Open is greater than the EMA or if the EMA is greater than the open. This is relevant because if you subtract the EMA from the Open, you could get a negative number which may not be what your logic is set up to check.

    I've recorded a short video showing how you could check if Open is greater than the EMA value, and then to check if the Open - the EMA value is less than a value you specify.

    Demo - https://drive.google.com/file/d/1xQM...w?usp=drivesdk

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,
      thank you for the information and the video! nice job!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Nat11, Today, 04:30 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Option Whisperer, Yesterday, 11:50 AM
      2 responses
      10 views
      0 likes
      Last Post Option Whisperer  
      Started by TraderJim618, Yesterday, 01:20 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by drpapp, 01-24-2019, 06:57 AM
      6 responses
      72 views
      1 like
      Last Post brucerobinson  
      Started by ttodua, 12-06-2019, 11:40 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X