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?
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Al Arabiya: US-Iran Draft Deal Within Hours Contains Hor …
Prediction Markets & Event Contracts
Double Deadlock: Rubio Calls Hormuz Tolls "Unfeasib …
Traders Hideout
Second Night of US Strikes Crushes Iran June 15 to 3.6% …
Prediction Markets & Event Contracts
 
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