Click here to Login





                                                   Intraday Variable for 'Entry Bar' and 'First Bar Of Day'

  0

0
Kiran
2015-05-03 15:57:29


In intra-day strategy, how do i access ..

1) price at the bar at which the position was entered? I want to enter a StopLoss in Points as follows -
e.g. stop_loss = close[entry_bar-1] - low[entry_bar-1];

2) the first bar of day - e.g. would like to specify a condition such as "buy at 3rd bar of day"

3) In general, how do i specify an absolute bar index e.g. high(3rd bar of the day).. I found a YTimeClose function that returns price at a specific time and helps, but this would be more elegant to test across systems with different bar intervals.


Would be nice to reference EntryBar and FirstBarOfDay as variables/functions we can use in strategy scripts.



QuantShare
2015-05-05 02:46:17



Hi,

1/ You can access this only using the money management script
The QS language is executed before the backtesting process to generate signals. It doesn't have access to trades and equity data.

2/

a = day() != ref(day(), X);

3/
a = day() != ref(day(), X);
b = valuewhen(a, high);



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
Random Value for Each Trading Bar
Time-series Sum for the first Minutes/Hours of a Trading Day
Set the First Trading Bar Values to Not a Number
5-Minute Historical Intraday Data for Forex, Indices and Futures/...
Return per Bar Stop - Money Management Strategy

How-to Lessons
How to change volume bar colors when the price closes down
How to display the bar index of a stock on a chart
How to download EOD quotes for active and valid stocks only
How to display the number of stocks per day for different RSI gro...
How to create volume bar charts

Related Forum Threads
Visible Date of first and last bar on chart
close next bar with intraday bars
How do you retrieve the entry and exit price for a position?
Previous day high and low in in intraday chart
Compress bar for custom database

Blog Posts
Day Trading: A trading system that combines intraday and EOD data
Different periodicities and chart bar types in QuantShare Trading...
6 ways to download free intraday and tick data for the U.S. stock...
Step by step on how to get free realtime/delayed data for stocks,...
Creating and managing notes for your stocks









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.