Click here to Login





                                                   EOD simulation but intraday stops and targets??

  0

0
umair
2013-03-28 09:51:13


Hi, is it possible to do a EOD simulation but use a intraday stoploss profit target. Meaning is it possible to set up stop losses in EOD simulation that have access to intraday data? This would be very helpful because I'm finding my self creating all these variables that are based on EOD data but the actual application for these variables is in intraday data. So I keep having to switch to different timeframe a

Example: setting = EOD simulation

A = xvariable > 5;
B = buy at open if a is true
Buy= b

Exit= hour() == 15; (again accessing intraday values while being in EOD simulation)

stoploss at 5 basis points (again would have to be able to access intraday values)


Thanks QS geniuses!!



QuantShare
2013-03-28 11:03:11

  0

Hi,

In an EOD simulation, using the variable "hour()" will always return "0".

If you want to exit at the end of the day, simply put:

sell = 1;

Regarding stoploss, by setting a 5 basis points, the simulator will initiate the stop loss if the price decreases by 5 points.
By default, it will create the order after the stop loss is initiated.

However, you can exit the position at the exact price, by updating the trading system, selecting "Settings -> Capital" then checking "Activate stop immediately".




umair
2013-03-28 19:28:19

  0

sell = 1; does not exit EOD. it creates the signal to exit and then exits the next day at open. any way to make it exit the day the signal is created?
side question, is there a way to execute all orders immediately rather than waiting for the next bar?

the stoploss suggestion you gave actually works. I'm just curious where the prices are coming from?

''active stop immediately'' is that just assuming that if ''low'' of the daily bar is less than stoploss, execute a ''immediate'' stop at stoploss price using a formula...for example (buyprice-(buyprice*.005)) OR is the 'active stop immediately'' feature actually checking intraday quotes to get the prices??



QuantShare
2013-03-28 21:04:49

  0

any way to make it exit the day the signal is created?

You just have to change the order type:
SetSimTiming(_Sell, _Close, -1);

Set sell order to execute at close price of today (-1).


The ''active stop immediately'' doesn't use intraday data. The order is executed at stop limit if this value is higher than day's low (as you said).



umair
2013-03-29 10:55:02

  0

Ok, excellent the setsimtiming works. i looked around but couldnt find a ''how to'' or more of an explanation for this variable. can you please explain? for me strategy i was able to get it to work

// Buy rules

a = Dropper(close,open,0,-0.005,-0.01,10,20,30);
buy = a > 100;

// Sell rules

sell = ref(close,-1);

SetSimTiming(_Buy, _Open, 0);
SetSimTiming(_Sell, _Close, -1);

but i had to use both the setsimtiming for buy and close to get the system to sell at EOD ( i looked copied a system you guys have created http://www.quantshare.com/item-1030-trading-system-based-on-the-previous-week-spy-return#)

am i doing this correctly?



QuantShare
2013-03-29 12:39:32

  0

Yes, this will buy at the open of tomorrow and sell at the close of today.

If you put "1" in the third variable then it will buy at the open of tomorrow + 1 (day).



umair
2013-03-29 22:35:34

  0

Ok that's great to know.

One more question.

If I put a limit profit order and a limit stoploss on EOD simulation, how will the simulation know which one came first?

In other words, does the "activate stop immediately" also work for limit profit targets? And if it does, does the simulator know if the stop hit first or if the profit target hit first in a EOD simulation




QuantShare
2013-03-30 10:37:15

  0

The "Activate stop immediately" also work for profit and trailing stops.

The simulation will not know if the stop loss or stop profit came first. It execute stops in the following order:
Stop Loss
Profit Stop
Trailing Stop
N-Bar Stop



giotrader
2017-07-15 16:00:46

  0

How can I do the opposite of what is told in this post, that is in an intraday strategy how can I set a stop that closes a position at the close of the day following the day the position was opened? All positions were not opened at the same time, so I don't think an n-bar stop would work.


QuantShare
2017-07-16 08:00:46

  0

sell = day() != ref(day(), -1);


giotrader
2017-07-17 08:26:27

  0

Thanks quantshare..


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
Brent and Crude Oil Continuous Futures Contracts - Intraday Data
5-Minute Historical Intraday Data for Forex, Indices and Futures/...
EOD Quotes Data for Hong Kong Stocks and ETFs
Historical EOD data for LSE-listed Stocks and ETFs
BSE Main and Sectoral Indices

How-to Lessons
How to download EOD quotes for active and valid stocks only
How to speed up watchlist and screener plug-ins when working with...
How to download historical EOD data for penny stocks
How to quickly download the most recent EOD data for your stocks
How to add a metric in the trading system simulation report

Related Forum Threads
INTRADAY VERSION AND SIZE OF DATA BASE
Previous day high and low in in intraday chart
Intraday Variable for 'Entry Bar' and 'First Bar Of Day'
Testing intraday strategy , but couldn't replicate thru formula.
Highest high and Lowest low difference intraday chart

Blog Posts
Day Trading: A trading system that combines intraday and EOD data
How to Backtest an Intraday Stock Trading System with EOD Ranking
6 ways to download free intraday and tick data for the U.S. stock...
Download historical EOD data for the stock, futures, ETF and Fore...
Backtesting a Strategy Based on Bond and Stock Index ETFs









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.