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

Easy Language into Ninja Script

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

    Easy Language into Ninja Script

    Hi

    I have TS Easy Language code (Pivot Reversal LE and Pivot Reversal SE) and want to get same translated into Ninja code for automated trading. Can someone help me out.

    Thanks in Advance.
    Parv

    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
    PIVOT REVERSAL LONG ENTRY:

    [IntrabarOrderGeneration = false]
    inputs: Strength( 4 ) ;
    variables: Setup( false ), PivotHigh( 0 ) ;

    if SwingHigh( 1, High, Strength, Strength + 1 ) <> -1 then
    { ie, if just confirmed SwHi }
    begin
    Setup = true ;
    PivotHigh = High[Strength] ;
    end
    else if Setup and High >= PivotHigh + 1 point then
    Setup = false ;
    { the High >= condition being true indicates that a buy must already have been triggered at this bar so this setup has been used up and needs to be negated; an example of a persisitent setup with an indefinite stop/limit trigger - setup has to be negated after entry confirmed; also see Keltner Channel LE/SE and PercentR LE/SE }

    if Setup then
    Buy ( "PivRevLE" ) next bar at PivotHigh + 1 point stop ;


    PIVOT REVERSAL SHORT ENTRY:

    [IntrabarOrderGeneration = false]
    inputs: Strength( 4 ) ;
    variables: Setup( false ), PivotLow( 0 ) ;

    if SwingLow( 1, Low, Strength, Strength + 1 ) <> -1 then
    { ie, if just confirmed SwLo }
    begin
    Setup = true ;
    PivotLow = Low[Strength] ;
    end
    else if Setup and Low <= PivotLow - 1 point then
    Setup = false ;
    { the Low <= condition being true indicates that a short must already have been triggered at this bar so this setup has been used up and needs to be negated; an example of a persisitent setup with an indefinite stop/limit trigger - setup has to be negated after entry confirmed; also see Keltner Channel LE/SE and PercentR LE/SE }

    if Setup then
    Sell Short ( "PivRevSE" ) next bar at PivotLow - 1 point stop ;

    #2
    Parv8, thanks for posting your code - if no one from the community steps up, you could always check with those NinjaScript consultants to get the conversion done for you - http://www.ninjatrader.com/webnew/pa...injaScript.htm
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by maybeimnotrader, Yesterday, 05:46 PM
    2 responses
    20 views
    0 likes
    Last Post maybeimnotrader  
    Started by adeelshahzad, Today, 03:54 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    7 responses
    32 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by merzo, 06-25-2023, 02:19 AM
    10 responses
    823 views
    1 like
    Last Post NinjaTrader_ChristopherJ  
    Started by frankthearm, Today, 09:08 AM
    5 responses
    22 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X