NexusFi: Find Your Edge


Home Menu

 





Programming an entry in script


Discussion in NinjaTrader

Updated
    1. trending_up 1,458 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?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
TradingView Opens Volume Footprint Data to Pine Script - …
TradingView
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 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