NexusFi: Find Your Edge


Home Menu

 





Programming an entry in script


Discussion in NinjaTrader

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




 
Search this Thread

Programming an entry in script

  #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: 109
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?
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
 
  #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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts