NexusFi: Find Your Edge


Home Menu

 





Programming an entry in script


Discussion in NinjaTrader

Updated
    1. trending_up 1,535 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
deandavis's Avatar
 deandavis 
Poulsbo, Wa US
 
Experience: Intermediate
Platform: NinjaTrader Tradestation
Broker: Ninja Trader, Continuum
Trading: ES, CL
Posts: 30 since Jul 2010
Thanks Given: 111
Thanks Received: 6

I am using Renko bars in Ninja Trader 7. Is possible to write code that will, based on a signal from my indicator, have a stop limit order entered at the current bar close plus x tics over or under depending if I want a long or short entry? My objective is to only enter positions on the bar after the signal if the price continues in the direction of the trade. Thanks in Advance.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Deal "In Review" at 87% on Deadline Day - …
Prediction Markets & Event Contracts
Iran Forward Curve: June 30 at 56% vs June 15 at 28% -- …
Prediction Markets & Event Contracts
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
S&P 500 Holds the Line: No Fast Track for SpaceX, Op …
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 rename 
Россия
 
Posts: 6 since Dec 2014


use strategy wizard. than change or add some code

 
Code
Initialize()
{
   AddPeriod( PeriodType.Range, 1);
   ...
}

OnBarUpdate()
{
   ...

   if (BarsInProgress == 1) { // last price changed by 1 tick
      double lastRenkoClose = Closes[0][0];  // primary dataserie last bar close
      double lastRenkoOpen = Opens[0][0];
      if (lastRenkoClose > lastRenkoOpen) {  // up bar
         if (Close[0] >= lastRenkoClose + OpenRangeTicks * TickSize) {  // check open long 
            // open long
         }
      } else {  // down bar
        if (Close[0] <= lastRenkoClose - OpenRangeTicks * TickSize) {  // check open short 
            // open short
         }
      } // else
   }
}


Reply With Quote




Last Updated on October 11, 2015


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts