Click here to Login





                                                   MMScript - Exit at the close of a bar

  0

0
Obuli Govindaraju
2013-05-04 17:21:11


I am testing a gap fill based trading system. The buy rule was rather easy - buy at the open of next bar when gapdown() function is 1.

I was successful at exiting at the open of the next bar(of the bar that closes the gap).

However I want to exit at the close of the bar that closes the gap (instead of next day open).

How do I do this through MM Script?



QuantShare
2013-05-05 11:19:21

  0

Best Answer
Hi,

When creating your order using the MM script, simply specify the "-1" as "orderLag" to buy at the close of the signal's bar.
Orders.CloseMarketOrder(-1, 5)




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
High to low stock pattern for the close price
How far are the close prices from the support line
Market Rule based on the Crossover Between Stock Close prices and...
Set the First Trading Bar Values to Not a Number
Decreasing the Trailing Stop Level every Trading Bar

How-to Lessons
How to display the bar index of a stock on a chart
How to change volume bar colors when the price closes down
How to display two stocks on the same chart
How to plot the number of stock tweets per day
How to add a metric in the trading system simulation report

Related Forum Threads
Money Management script and exit options in the wizard
close above the highest high in the last 5 days
close next bar with intraday bars
How do you retrieve the entry and exit price for a position?
How do I refer to the close price of another symbol in a formula?

Blog Posts
The Ultimate Guide to Create Trading Systems in QuantShare
How to create market indicators using the composite function - Pa...
Introduction to the Grid Tool
How to Select the Best Market Indicator for your Trading System
Backtesting chart patterns using the auto support and resistance ...









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 2019 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.