Click here to Login

Trading Software Trading objects Features How-to Blog Search


                                                   Help with the following trading system

  0

0
suresh
2010-08-30 09:34:22


I want to code the following trading system.

Buy next bar at current low.
After the purchase, sell next bar at limit of high of purchase bar.
If position open for more than 3 bars, sell at market.

So the positions should be held atleast 1 bar, maximum 4 bars.

The current implementation I have closes the position on same day as purchase



QuantShare
2010-08-30 10:50:32

  0

Best Answer
Hi,

Here is the trading system implementation:

Buy next bar at today's low:
Set your buy rule and set the buy limit price to buy at tomorrow "low".

Sell next bar at limit of high of purchase bar:
Set "1" as sell rule and set the sell limit price to sell at tomorrow "high". Because the sell rule is set to 1, it will be executed on the same day the stock was purchased and then will use the high price of the purchase bar.

Set N-Bar Stop to 4 bars.



suresh
2010-08-30 11:08:50

  0

I do not want to sell on the day of purchase. This is the code that was generated. Please tell me how to modify this so that I will not sell on the same day as purchase. PS. I want to avoid the situation, when the high price occurs at the open and the low price happens at close.

BuyPrice(low, 0);
SellPrice(high, 5);

// Buy rules

Rule1 = (1) > (0);
buy = (Rule1);

// Sell rules

Rule2 = (1) > (0);
sell = (Rule2);




QuantShare
2010-08-30 12:05:44

  0

This system does not sell on the same date as the purchase date.
Make sure you use sell at tomorrow order type.

Please verify your trades.



suresh
2010-08-30 12:13:46

  0

OK. It is after 1 day. Now what is Nb Bars. It shows as 0 for trades that are sold the next day. I was ASSuming that it is numbers of bars the trade is held.


QuantShare
2010-08-30 12:25:13

  0

We will fix this. Thanks.


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
Trading Rules to use with the Trading System Optimizer
Design and backtest a trading system with two strategies
Ratio of the Short to Long-Term Moving Averages - ETF Trading Sys...
Trading System based on the Previous Week SPY Return
Trading System Based on the CloseHL Percent Rank Oscillator

How-to Lessons
How to optimize the stop limit of a trading system
How to optimize the number of positions in a trading system
How to add a metric in the trading system simulation report
How to debug a trading system using the money management tool
How to generate buy/sell signals from a trading system

Related Forum Threads
Ranking System with Trading System Help, Revisited
Add a trading system to the price volume chart
Ranking System Help
Trading System based on the Linear Regression of the RSI Indicato...
Trading System Simulation Errors

Blog Posts
Synchronize Buy/Sell List of Rules in the Trading System Optimize...
Basic trading system implemented using the money management tool
Trading Forex with the commitments of traders report
Trading System: Buy stocks with the highest Sharpe ratio
3 ways to rank stocks in a trading system - Simulator and Potfoli...









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 © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items