Loading ...
Sorry, an error occurred while loading the content.
 

Re: [TOS_thinkscript] Re: DMI crossover

Expand Messages
  • Adam Green
    Seems like you might be making it harder than it need be. The error you re encountering is that the interpreter sees no plot Diff out of DMI, it simply
    Message 1 of 6 , Feb 15, 2010
    Seems like you might be making it harder than it need be.  The error you're encountering is that the interpreter sees no plot "Diff" out of DMI, it simply doesn't exist, so it can't be referenced.

    I've taken the predefined DMI and added a simple crossover detection plot.  See attached.  Maybe it's what you're looking to do.

    On Mon, Feb 15, 2010 at 10:30 AM, jcastellanosg <jcastellanosg@...> wrote:
     

     Yes I have tried first those, but are differents, what I want to do is to know when the DI+ crosses below/above the DI+. The others  indicators tell when it cross umm the 20 or the 60 of the DMI.

     

    In Ninja trader I have done  like this:

     

    If (cross below (DM (14).Diplus, DM (14). Diminus)……. Do…….

     

    But when I tried in Ninja

     

    def hiDiff = high - high[1];

    def loDiff = low[1] - low;

    def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;

    def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;

    def ATR = WildersAverage(TrueRange(high, close, low), length);

    def Dplus = 100 * WildersAverage(plusDM, length) / ATR;

    def Dminus = 100 * WildersAverage(minusDM, length) / ATR;

     

    def Diff = DMI (Dplus, Dminus).Diff;

     

    plot signal = crossover(crossingType == CrossingType."Negative to Positive", Diff > 0);

     

    It gives me an error on the Stament DMI, it appears that it cannot be use with the diff.


    Regards.


    --- In TOS_thinkscript@yahoogroups.com, Adam Green <adam.cell.phone@...> wrote:
    >
    > Have a look at the ADX ADXCrossover and ADXR predefined studies.
    >
    > On Fri, Feb 12, 2010 at 5:43 PM, jcastellanosg jcastellanosg@...wrote:

    >
    > >
    > >
    > > Does someone have an indicator that plot the crossover between the DI- and
    > > the DI+.
    > >
    > > Regards.
    > >
    > >
    > >
    >
    >
    >
    > --
    > Adam
    >




    --
    Adam
  • jcastellanosg
    That s exactly what I want!!! Regards,
    Message 2 of 6 , Feb 15, 2010
      That's exactly what I want!!!

      Regards,

      --- In TOS_thinkscript@yahoogroups.com, Adam Green <adam.cell.phone@...> wrote:
      >
      > Seems like you might be making it harder than it need be. The error you're
      > encountering is that the interpreter sees no plot "Diff" out of DMI, it
      > simply doesn't exist, so it can't be referenced.
      >
      > I've taken the predefined DMI and added a simple crossover detection plot.
      > See attached. Maybe it's what you're looking to do.
      >
      > On Mon, Feb 15, 2010 at 10:30 AM, jcastellanosg <jcastellanosg@...>wrote:
      >
      > >
      > >
      > > Yes I have tried first those, but are differents, what I want to do is to
      > > know when the DI+ crosses below/above the DI+. The others indicators tell
      > > when it cross umm the 20 or the 60 of the DMI.
      > >
      > >
      > >
      > > In Ninja trader I have done like this:
      > >
      > >
      > >
      > > If (cross below (DM (14).Diplus, DM (14). Diminus)……. Do…….
      > >
      > >
      > >
      > > But when I tried in Ninja
      > >
      > >
      > >
      > > def hiDiff = high - high[1];
      > >
      > > def loDiff = low[1] - low;
      > >
      > > def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
      > >
      > > def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0;
      > >
      > > def ATR = WildersAverage(TrueRange(high, close, low), length);
      > >
      > > def Dplus = 100 * WildersAverage(plusDM, length) / ATR;
      > >
      > > def Dminus = 100 * WildersAverage(minusDM, length) / ATR;
      > >
      > >
      > >
      > > def Diff = DMI (Dplus, Dminus).Diff;
      > >
      > >
      > >
      > > plot signal = crossover(crossingType == CrossingType."Negative to
      > > Positive", Diff > 0);
      > >
      > >
      > >
      > > It gives me an error on the Stament DMI, it appears that it cannot be use
      > > with the diff.
      > >
      > >
      > > Regards.
      > >
      > > --- In TOS_thinkscript@yahoogroups.com, Adam Green <adam.cell.phone@>
      > > wrote:
      > > >
      > > > Have a look at the ADX ADXCrossover and ADXR predefined studies.
      > > >
      > > > On Fri, Feb 12, 2010 at 5:43 PM, jcastellanosg jcastellanosg@...:
      > >
      > > >
      > > > >
      > > > >
      > > > > Does someone have an indicator that plot the crossover between the DI-
      > > and
      > > > > the DI+.
      > > > >
      > > > > Regards.
      > > > >
      > > > >
      > > > >
      > > >
      > > >
      > > >
      > > > --
      > > > Adam
      > > >
      > >
      > >
      > >
      >
      >
      >
      > --
      > Adam
      >
    • Adam Green
      That s great. Happy to help. ... -- Adam That s great.  Happy to help. On Mon, Feb 15, 2010 at 4:38 PM, jcastellanosg wrote:  
      Message 3 of 6 , Feb 15, 2010
        That's great.  Happy to help.

        On Mon, Feb 15, 2010 at 4:38 PM, jcastellanosg <jcastellanosg@...> wrote:
         


        That's exactly what I want!!!



        Regards,

        --- In TOS_thinkscript@yahoogroups.com, Adam Green <adam.cell.phone@...> wrote:
        >
        > Seems like you might be making it harder than it need be. The error you're
        > encountering is that the interpreter sees no plot "Diff" out of DMI, it
        > simply doesn't exist, so it can't be referenced.
        >
        > I've taken the predefined DMI and added a simple crossover detection plot.
        > See attached. Maybe it's what you're looking to do.
        >
        > On Mon, Feb 15, 2010 at 10:30 AM, jcastellanosg <jcastellanosg@...>wrote:

        >
        > >
        > >
        > > Yes I have tried first those, but are differents, what I want to do is to
        > > know when the DI+ crosses below/above the DI+. The others indicators tell
        > > when it cross umm the 20 or the 60 of the DMI.
        > >
        > >
        > >
        > > In Ninja trader I have done like this:
        > >
        > >
        > >
        > > If (cross below (DM (14).Diplus, DM (14). Diminus)……. Do…….
        > >
        > >
        > >
        > > But when I tried in Ninja
        > >
        > >
        > >
        > > def hiDiff = high - high[1];
        > >
        > > def loDiff = low[1] - low;
        > >
        > > def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
        > >
        > > def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0;
        > >
        > > def ATR = WildersAverage(TrueRange(high, close, low), length);
        > >
        > > def Dplus = 100 * WildersAverage(plusDM, length) / ATR;
        > >
        > > def Dminus = 100 * WildersAverage(minusDM, length) / ATR;
        > >
        > >
        > >
        > > def Diff = DMI (Dplus, Dminus).Diff;
        > >
        > >
        > >
        > > plot signal = crossover(crossingType == CrossingType."Negative to
        > > Positive", Diff > 0);
        > >
        > >
        > >
        > > It gives me an error on the Stament DMI, it appears that it cannot be use
        > > with the diff.
        > >
        > >
        > > Regards.
        > >
        > > --- In TOS_thinkscript@yahoogroups.com, Adam Green <adam.cell.phone@>
        > > wrote:
        > > >
        > > > Have a look at the ADX ADXCrossover and ADXR predefined studies.
        > > >
        > > > On Fri, Feb 12, 2010 at 5:43 PM, jcastellanosg jcastellanosg@...:

        > >
        > > >
        > > > >
        > > > >
        > > > > Does someone have an indicator that plot the crossover between the DI-
        > > and
        > > > > the DI+.
        > > > >
        > > > > Regards.
        > > > >
        > > > >
        > > > >
        > > >
        > > >
        > > >
        > > > --
        > > > Adam
        > > >
        > >
        > >
        > >
        >
        >
        >
        > --
        > Adam
        >




        --
        Adam
      Your message has been successfully submitted and would be delivered to recipients shortly.