NexusFi: Find Your Edge


Home Menu

 





Any coder to help modifying a strategy to trade at specified time ?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one energetic with 2 posts (0 thanks)
    2. looks_two redratsal with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 fluxsmith with 1 posts (1 thanks)
    1. trending_up 2,607 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Any coder to help modifying a strategy to trade at specified time ?

  #1 (permalink)
 energetic 
hk
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 55 since Apr 2010
Thanks Given: 23
Thanks Received: 17

Any coder to help modifying a strategy to trade at specified time ?
i.e. I want to trade form last 2 hrs before market close.
thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
51 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
31 thanks
What percentage per day is possible? [Poll]
31 thanks

  #3 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090



energetic View Post
Any coder to help modifying a strategy to trade at specified time ?
i.e. I want to trade form last 2 hrs before market close.
thanks


if (ToTime(Time[0]) > StartTime && ToTime(Time[0]) < EndTime)

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 energetic 
hk
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 55 since Apr 2010
Thanks Given: 23
Thanks Received: 17

thanks..........................



redratsal View Post
if (ToTime(Time[0]) > StartTime && ToTime(Time[0]) < EndTime)


Started this thread Reply With Quote
  #5 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322


redratsal View Post
if (ToTime(Time[0]) > StartTime && ToTime(Time[0]) < EndTime)

Keep in simple when you can (like above). But if you need to support a time range which spans local midnight, structure it like this (from a function wich receives Time[0] as a parameter named '_now', and returns a boolean as to if we're in the timespan):

 
Code
TimeSpan now = _now.TimeOfDay;
 
if ( startTime.CompareTo(endTime) < 0 ) { // Time range is intra-day
   if ( now.CompareTo(startTime) > 0
     && now.CompareTo(endTime) <= 0 )
   returntrue;
}
else                                      // Time range spans midnight
if ( now.CompareTo(startTime) > 0
  || now.CompareTo(endTime) <= 0 )
   returntrue;

returnfalse;


Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to fluxsmith for this post:





Last Updated on February 5, 2011


© 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