Click here to Login





                                                   How can I associate a field (value) to a trade in a MM script?

  0

0
Dave Walton
2013-07-22 06:33:07


Hi, I am looking-up dividends that occurred during a trade and I want to associate it with the correct position so I can use it later in calculations in OnEndSimulation. I tried Adding the dividend in an ArrayList, assuming that MMPosition[] pos = Portfolio.GetAllPositions() will be stored in the same order as the OnClosePosition was executed. It is not working. In fact I can't see how the order of trades closed on the same bar using Portfolio.GetAllPositions() is determined. Can you help me figure this out?


QuantShare
2013-07-23 19:20:19

  0

How are you looking for dividends? How are you storing dividends in the ArrayList?




Dave Walton
2013-07-24 23:42:14

  0

You can forget about this question-- I figured it out. I'm using a call to the custom dividend database. I was storing the dividends in an ArrayList for later processing. Instead I just added a trade metric from within OnEndPeriod which associated it correctly.


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
Trade Plan - Entries/Profit Target/Stop Loss
Fixed Risk per Trade - Position Sizing
Sum of a Custom Database's Field
How far are the close prices from the support line
Historical trading volatility-based system to adjust trade sizes

How-to Lessons
How to quickly select stocks based on the last value of a databas...
How to associate an index with a list of stocks
How to create and trade a Neural Network model
How to hide stock data outside of regular trading hours
How to automate the data downloading process

Related Forum Threads
How can I set Log Scale charts?
How can I see charts with logarithmic scale on y-axis?
How can I incorporate earnings release data into my backtests scr...
How can I view signals rejected by the simulator?
How to I delete all symbols in which a field is empty?

Blog Posts
How to use QuantShare screener to trade penny stocks
How to predict and trade the stock market using pivot points
Industry Analysis - How to Compare Stocks with their Industries
How to build and backtest a robust stock trading system
3 Items To Get and Trade the News In QuantShare Platform









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.