Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA offset

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

  • s.kinra
    replied
    Hello jpatri,
    You can use as below:
    Code:
    if(CrossAbove(Close, Ema_upr, 1)
    { // your code here }
    else if(CrossBelow(Close, Ema_lwr, 1)
    { // Your code here }
    Hope it helps!

    Leave a comment:


  • jpatri
    replied
    Chelsea B.
    Thank you for your input!
    .kinra's solution did work perfectly. I was able to plot the three EMA lines as I wanted.
    Now I am trying to figure out how to attach a cross over function to place a buy order as the price crossed above or below each of the 24 tick extremes. Since I am not a coder, I am working it slowly.

    Thank all for you help with the 24 tick plots, This is a very helpful blog!

    jpatri

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Joe P.,

    s.kinra is correct in that while you can apply an offset to an indicator plot for a condition, this does not change the indicator plot on the chart and does not visually add the offset to the indicator with 'Plot on chart' enabled.

    My recommendation would be to create an indicator (and not a strategy) with the code that s.kinra has suggested which has 3 plots and sets these plot values with an offset. Then call this indicator from your strategy in the strategy builder.

    Leave a comment:


  • jpatri
    replied
    Hello s.kinra,
    Thank you for the file, it worked perfectly. It is plotting a center 21 day EMA, with a 21 day EMA 24 ticks above and another 24 ticks below.
    I am now trying to load it into Ninjascript editor to try add the rest of my strategy.
    Thank you!
    jpatri

    Leave a comment:


  • s.kinra
    replied
    Hello jpatri,
    I believe there is some limitation of Strategy Builder & you won't be able to get what you're expecting. You can have the plot in Strategy Builder by selecting Add to Chart, but it won't allow you to add ticks to it.
    I am attaching a sample strategy for reference, it will add the three moving averages you're looking for so you can add your logic in this to get working.
    EMAoffset.zip

    Leave a comment:


  • s.kinra
    replied
    Hello jpatri,
    Can you share your strategy so it would be easier to help.

    Leave a comment:


  • jpatri
    replied
    Hello s.kinra,
    Thank you very much for your rely to my request!
    Your solution appears to be ninjascript code? I am not able to find (plot) in the strategy builder and I am inept at coding. If there is a Strategy Builder solution you can suggest I would be grateful.
    Thank you,
    jpatri

    Leave a comment:


  • s.kinra
    replied
    Hello jpatri,
    You can use as below:-
    Code:
    Plot1[0] = ema[0];
    Plot2[0] = ema[0] + 24 * TickSize;
    Plot3[0] = ema[0] - 24 * TickSize;
    Hope it helps!

    Leave a comment:


  • jpatri
    started a topic EMA offset

    EMA offset

    Hello,
    I would like to build a strategy in Strategy Builder that plots a 21 day EMA line with a 21 day EMA line plotted 24 ticks above and a 21 day EMA line 24 ticks below the first EMA plot. I am hoping to create three paralleled EMA lines, then use them in a cross strategy.

    I have not been able to make the off sets work, can anyone help with this?

    Thank you,
    Joe P..

Latest Posts

Collapse

Topics Statistics Last Post
Started by SuneSorgenfrei, Today, 09:29 AM
0 responses
5 views
0 likes
Last Post SuneSorgenfrei  
Started by dodoei, Today, 07:24 AM
0 responses
8 views
0 likes
Last Post dodoei
by dodoei
 
Started by thecashguys, Today, 06:13 AM
0 responses
10 views
0 likes
Last Post thecashguys  
Started by rajeshks1988, Today, 05:32 AM
0 responses
11 views
0 likes
Last Post rajeshks1988  
Started by mbcmbc, Today, 05:29 AM
0 responses
6 views
0 likes
Last Post mbcmbc
by mbcmbc
 
Working...
X