NexusFi: Find Your Edge


Home Menu

 





timed exit


Discussion in Platforms and Indicators

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




 
Search this Thread
  #1 (permalink)
sr114
Kolkata+India
 
Posts: 27 since Aug 2012
Thanks Given: 10
Thanks Received: 1

Hello Boarders

in developing intraday system how we could use the concept of timed exit at a certain time of the trading hours?
it must be applicable for range bars also beside the actual time frame ( for any tf its easy but for range bars - what to do?)

for example - we take a simple ma crossover system of a fast average and slow average.

f=fast average;
s=slow average;

so the buy and sell will be

buy=Cross(f,s);
sell=Cross(s,f); // and exit at 2300 hrs;

plot (C,"",colorgreen, 64);
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), 51 );
PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), 42);


now if to implement that the sell condition also have a timed exit part - i.e. at a certain time - lets say at 2300 hrs - all active trade will be closed - be it buy or sell.

what is the code to be used for the timed exit?

in a breakout system, what will be a good cover and exit condition?

breakout condition for bur or sell ( cover/exit logic, code needed for this buy/sell trade)

Buy =Cross( C, Ref( HHV(H,Buyperiods), -1 )) ;
Sell =Cross(Ref(LLV(Low,Sellperiods),-1),C) ;


what condition can we apply here in the buy or sell for a good cover or exit from the trade?


rgds
sr


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
UCL Final Kicks Off at Noon ET: PSG at 56.5% as Iran May …
Prediction Markets & Event Contracts
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
The Ceasefire Curve: 2pct Peace by Next Week, 60pct by S …
Prediction Markets & Event Contracts
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #2 (permalink)
 dwitkin 
Reston, Virginia
 
Experience: Advanced
Platform: ThinkOrSwim, AmiBroker
Broker: ThinkOrSwim, TradeStation
Trading: Metals, Grains
Posts: 7 since Nov 2010
Thanks Given: 18
Thanks Received: 3

If I'm understanding what you want, this should do what you are looking for...

Defines when to enter trades, and when to exit.

 
Code
/* Define trading start and end times. Don't take trades outside these times */
/* Include in entry/exit rules only when trading equity markets */
FirstTradeTime = 094500;				// Earliest time to take a trade
LastTradeTime = 153000;					// Latest time to take new trades
ExitAllPositionsTime = 154500;		// Exit all trades
 
Code
/* Buy & Sell Section */

Buy = 	... AND
		(TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime );

// For US equities markets, exit when the current time is greater than a certain time of Day (e.g., > 15:30)
Sell = ... OR
	 TimeNum() >= ExitAllPositionsTime;
And just use the same logic for the Sell Short and Cover.


Reply With Quote
Thanked by:
  #3 (permalink)
sr114
Kolkata+India
 
Posts: 27 since Aug 2012
Thanks Given: 10
Thanks Received: 1



dwitkin View Post
If I'm understanding what you want, this should do what you are looking for...

Defines when to enter trades, and when to exit.

 
Code
/* Define trading start and end times. Don't take trades outside these times */
/* Include in entry/exit rules only when trading equity markets */
FirstTradeTime = 094500;				// Earliest time to take a trade
LastTradeTime = 153000;					// Latest time to take new trades
ExitAllPositionsTime = 154500;		// Exit all trades
 
Code
/* Buy & Sell Section */

Buy = 	... AND
		(TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime );

// For US equities markets, exit when the current time is greater than a certain time of Day (e.g., > 15:30)
Sell = ... OR
	 TimeNum() >= ExitAllPositionsTime;
And just use the same logic for the Sell Short and Cover.

Hi

thanx for the prompt reply

for a time frame based afl this logic will work, but for a range bar type it is not working?
as range bars are time independent

also cud u specify a good cover/exit logic in this case , then the time based exit can be over rided

rgds
sr


Reply With Quote




Last Updated on January 16, 2013


© 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