Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 algospoke, Yesterday, 06:40 PM
      2 responses
      18 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      44 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      20 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      180 views
      0 likes
      Last Post jeronymite  
      Working...
      X