Click here to Login





                                                   How to modify a pending order in the OnEndPeriod event of AMM?

  0

0
Chaim6
2014-10-25 22:36:23


Is there a way to modify the number of shares to be bought from within the OnEndPeriod event?

Thanks.



QuantShare
2014-10-27 02:39:37

  0

Best Answer
You can access pending orders in the "OnEndPeriod".

Here is an example:

_TradingOrder[] orders = Orders.GetPendingBuyOrders();
if(orders.Length > 0)
{
orders[0].NbShares = 100;
orders[0].SubmitChanges();
}



Chaim6
2014-10-27 20:02:05

  0

I didn't realize that the changes need to be 'submitted'. That should do it.

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
Number of Times an Event Occurred in the First N-Minutes of a Tra...
How far are the close prices from the support line
Trading Strategy based on the Number of Buy Signals
Investing in stocks using the Kelly criterion money management st...
Money Management System to Split Order Into Smaller Pieces

How-to Lessons
How to dynamically change the number of positions in a portfolio?
How to improve the performance of QuantShare databases?
How to plot the number of stock tweets per day
How to automate the data downloading process
How to add a metric in the trading system simulation report

Related Forum Threads
How to get the last day of the month in C#
How do I reduce a position size from within the Money Management
How to update the custom variables (var1,var2,...) in a position ...
How do you retrieve the entry and exit price for a position?
How to browse and search the blog?

Blog Posts
How to download the history of dividend payments for stocks in th...
How to use the new Market Regimes Feature in QuantShare Trading S...
Sentiment Analysis: How to measure the sentiment score of your st...
Fundamental analysis: How to track economic indicators in the For...
How to predict and trade the stock market using pivot points









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.