Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need Help converting EasyLanguage Code

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

    Need Help converting EasyLanguage Code

    I am trying to move to NinjaTrader for good and converting some of own easylanguage indicators. But I am having trouble converting a portion of the code (below).

    Your input is much appreciated.
    Many thanks.


    Variables calculated elsewhere: AVG,SRATR,SRAVG,UpperZone,LowerZone;

    "tick" function is used in Tradestation but not sure of its equivalent in Ninja.

    "Xaverage" is exponential mov. avg.

    Need help converting the following portion of the easylanguage code:


    if Close>AVG and Close>UpperZone then
    begin
    X=xaverage(high-(tick*6),SRAVG);
    If (X<X[1] or (X< (X[1]+SRATR*(AvgTrueRange(10))))) then
    X=X[1] else X=X;

    end Else

    if Close<AVG and Close<LowerZone then
    begin
    X=XAverage (low+(tick*6),SRavg);
    If (X>X[1] or (X> (X[1]-SRATR*(AvgTrueRange(10))))) then
    X=X[1] else X=X;

    end else X=X[1];

    #2
    Hello iffyM,

    Welcome to the NinjaTrader Support Forums!

    While I am not very familiar with EasyLanguage, I would suggest going through our Help Guide was we do have an extensive section that goes over Basic Programming Concepts when using NinjaScript (C# and .NET based) as well as tutorials on building Indicator that will help you get up to speed on NinjaScript. The following link to our Help Guide on our Educational Section that you may view.


    You may also view the following thread post that has other great links to get you get started.


    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by iffyM View Post
      I am trying to move to NinjaTrader for good and converting some of own easylanguage indicators. But I am having trouble converting a portion of the code (below).

      Your input is much appreciated.
      Many thanks.


      Variables calculated elsewhere: AVG,SRATR,SRAVG,UpperZone,LowerZone;

      "tick" function is used in Tradestation but not sure of its equivalent in Ninja.

      "Xaverage" is exponential mov. avg.

      Need help converting the following portion of the easylanguage code:


      if Close>AVG and Close>UpperZone then
      begin
      X=xaverage(high-(tick*6),SRAVG);
      If (X<X[1] or (X< (X[1]+SRATR*(AvgTrueRange(10))))) then
      X=X[1] else X=X;

      end Else

      if Close<AVG and Close<LowerZone then
      begin
      X=XAverage (low+(tick*6),SRavg);
      If (X>X[1] or (X> (X[1]-SRATR*(AvgTrueRange(10))))) then
      X=X[1] else X=X;

      end else X=X[1];
      if ( Close[0] >AVG & Close[0] > UpperZone )
      {
      X = xaverage(High[0] - ( tick*6 ), SRAVG );
      if ( (X<X[1] | (X< (X[1]+SRATR*(AvgTrueRange(10))))) )
      { X=X[1] }
      else {X=X; }
      }
      else
      {
      if ( Close[0] < AVG & Close[0] < LowerZone )
      {
      X=XAverage (Low[0]+(tick*6),SRavg);
      If ( (X>X[1] | (X> (X[1]-SRATR*(AvgTrueRange(10))))) )
      { X=X[1] }
      else { X=X; }
      }
      else { X=X[1]; }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X