Click here to Login





                                                   AddTradeMetric AMM

  0

0
David
2021-08-19 18:01:49


Hi

I am exporting the "Realized Trades" data from a simulation to LibreOffice Calc.

I have added trade metrics via the AddTradeMetric method, but this only allows adding a number, is there any way to add a string?

What I would like is to have a column called "Sector", under which the symbols sector can be added.

Currently I'm creating a new column for each sector i.e.
pos.AddTradeMetric("" + Data.GetSymbolInfo(pos.Symbol).Sector + "",1);

It would be so much cleaner if I could do something like

pos.AddTradeMetric("Sector",Data.GetSymbolInfo(pos.Symbol).Sector);

Main reason is when using a pivot table, it is alot easier to work with one field than many.

I guess I could get around this by using a switch statement based on the sector, and assigning a number to each sector, but just before I do that, I'm I missing something here?

Thanks



QuantShare
2021-08-25 04:36:04

  0

Unfortunately, "AddTradeMetric" function accepts only double values.
You can either assign a numeric value to each sector via a switch or create your own table/dic within the MM script and save it to a csv file in the "OnEndSimulation" event.



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
Sector Surfer AMM Model
Adaptive Asset Allocation Butler V1.3 AMM
Minimum Variance Optimization with Solver V1.1- AMM
Global Market Rotation Strategy V1.4
Custom Trading System Rebalancing

How-to Lessons
How to display the number of stocks per day for different RSI gro...
How to debug a downloader
How to filter stocks in a market composite
How to install the previous version of QuantShare
How to plot the relative performance of several stocks/indices

Related Forum Threads
Equity to Symbol - AMM / Script
AMM scripting - error and some questions
AMM ATS script
Comp() in QS language and AMM if no Market Data
AMM script global variables do not appear to be thread safe

Blog Posts
QuantShare Trading Software: New Features in the 3.4.0 Version
Limit and Market orders
Let QuantShare Manage your List of Securities
Update Chart Layout based on Active Ticker Symbol
Detect chart patterns using the auto support/resistance indicator









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