Click here to Login





                                                   No overnight positions

  0

0
Matt Johnson
2015-04-25 21:31:54


Is it possible to set up a close/cover rule or stop so that all positions are exited before the close of the trading day? If so can you please provide the code to do so. I am working on a 1-minute intraday strategy and do not want to hold any positions overnight. Thank you in advance!


QuantShare
2015-04-27 04:02:23

  0

Hi Matt,

Here is how:

nd = day() != ref(day(), -1);
sell = nd;
cover = nd;
SetSimTiming(_Sell, _Close, -1);
SetSimTiming(_Cover, _Close, -1);



chaz
2015-05-06 14:50:36

  0

Mat,
Assuming you are trading during standard NYSE trading hours 9.30 - 16.00, you can try my approach for intrday 1min timeframe:

Time2Sell = 930; // ex.: sell after 15.30 -> 15*60+30
TradingTime = Hour()*60 + Minute() ;

sell = Your_formula || TradingTime >= Time2Sell ;
cover = Your_formula || TradingTime >= Time2Sell ;

It gives you more control and time to get orders filled; going for last minute period may not get orders filled, at least it is my experience.



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Holding period return - classifying positions
Overnight Gap Up Trading System
Minimum Number of Positions in a Trading System
EURUSD Long Positions Ratio
Money management to Reject Trading Positions Based on their Past ...

How-to Lessons
How to dynamically change the number of positions in a portfolio?
How to optimize the number of positions in a trading system
How to quickly add several positions to your portfolio
How to use the Fibonacci retracement drawing tool
How to create a strategy-based portfolio

Related Forum Threads
Detect flat positions
Different Stops for Long/Short Positions
Holding Constant Positions
How to define an alternate asset to buy when no positions are hel...
How to read the number of positions in trading system

Blog Posts
How to Create Custom Metrics for Your Trading Positions
Ranking system calculation methods
QuantShare Trading Software: New Features in the 3.3.1 Version
Create Profitable Trading Strategies with Exchange Traded Funds (...
Trading System Analysis: Backtesting report and custom measures









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.