Click here to Login





                                                   Limit Order

  0

0
umair
2013-02-03 01:00:58


Buy if price crosses opening price of the day +.50 points
Only one trade per day. Price is the last trade.

Any assistance will be much appreciated!



umair
2013-02-03 06:16:14

  0

+stoploss of ''0'' points

Does that mean that if the price goes below my entry price, the system will sell at the next bar?



QuantShare
2013-02-04 09:46:55

  0

To buy when price crosses opening price of the day + 0.5 points, type the following formula:

buy = close > (open + 0.5);



umair
2013-02-05 03:49:07

  0

Thanks the logic works but not quite what I'm trying to do:

Opening price I want to use is the price at 9:30. Not every single candle. So if the market opened today at 9:30 and the price was 100. I want to buy if the price crosses 100.5

What the above formula is doing is that it keeps buying everytime a 1 min candle has a close > open+.5

Also how can I tell the logic to close all positions at EOD. B/c I'm noticing that some of my logics end up buying the stock at 4PM (the last minute of trading hours) and then the position wont be sold till the next day. This happens even though my sell logic is "(hour() == 16 and minute() == 00)"



umair
2013-02-05 03:58:03

  0

Example:

9:30 price= 100
9:35 price= 100.5
BUY at 100.5 or next opening minute bar
Just one trade a day, meaning once my profit target/stoploss is hit, the logic exits my position and waits till the next day



umair
2013-02-05 04:10:26

  0

buy = close > (ref(open,(hour() == 9 and minute() == 30)) + 0.2)

Thats what I have but It does not work properly.



umair
2013-02-05 04:43:13

  0

buy = close > (TimeframeGetSeries1("A", 1, close, LastData, 1) + (0.5))

Still doesn't work.



QuantShare
2013-02-05 12:25:51

  0

I thought you were backtesting an EOD system.

To get the open price of today:
a = HistoPrice(_open, 0);

Note that you can always plot a variable on a chart to see exactly how it works.




umair
2013-02-05 18:38:56

  0

How can I limit my buy logic to only trigger a buy once a day?


QuantShare
2013-02-05 20:55:54

  0

Add the following rule:

hour() == 9 and minute() == 30




umair
2013-02-06 04:25:54

  0

Hi Quant, there has to be a better way to limit the logic to only trigger once.

''hour() == 9 and minute() == 30'' will not work since my limit order is open price at 9:30 + .20 points. Lets say at 10AM the price croses day's opening price+.20 points I want to buy then, and then sell at my profit target or EOD. And if my profit target is hit at 11AM, then I don't want the logic to trigger again. Right now it's triggering again since the price at 11AM is > days opening price+.20



QuantShare
2013-02-06 11:00:02

  1

You have many solutions:

- Solution 1: Using the strategy formula, you can type something like:

rule1 = close > HistoPrice(_open, 0) + 0.2;
newday = barssince(day() != ref(day(), 1));
buy = sumif(rule1, 1, newday+1) == 1 and rule1;

- Solution 2: Set "'hour() == 9 and minute() == 30" as buy rule then set a stop order with "HistoPrice(_open, 0) + 0.2" as stop rule

- Solution 3: Use the money management script to implement that



umair
2013-02-06 15:45:54

  0

Great, thx Quant


umair
2013-02-07 02:56:42

  0

Hey Quant any idea the below isn't capturing all the gap downs? Gap down= today's opening price < yesterday's closing price. And I only want to make one trade per day.

rule1 = histoprice(_open, 0) < HistoPrice(_close, 1);
newday = barssince(day() != ref(day(), 1));
buy = sumif(rule1, 1, newday) == 1 and rule1;


It's making trades but it's not capturing all the gap downs that I can see on the chart



umair
2013-02-07 03:02:43

  0

nvm that works..


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
Transform any order into a limit order selectively based on a tra...
Money Management System to Split Order Into Smaller Pieces
Entry Trailing Stop
Opening and Closing Crosses - Share Volume
Optimizable Fibonacci Long and Short Trading System

How-to Lessons
How to set order type of a trading system programmatically
How to optimize the stop limit of a trading system
How to dynamically change the number of positions in a portfolio?
How to quickly add a ticker symbol
How to plot two different time frames in the same chart

Related Forum Threads
How can I build up an trailing stop limit buy order
Buy/Sell order types w/Simulator
Filter out limit orders that doesn't trade through limit price
Multiple Sell Order Types in a single system
OnNewPosition and Timestamps and Order ID

Blog Posts
Limit and Market orders
True portfolio simulation applied to trading systems
QuantShare Trading Software: New Features in the 3.1.2 Version
Sentiment Analysis: How to measure the sentiment score of your st...
How to use QuantShare screener to trade penny 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.