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

How-to Lessons
How to quickly select stocks based on the last value of a databas...
How to create histogram charts
How to download EOD quotes for active and valid stocks only
How to create a composite index/indicator
How to create and trade a Neural Network model

Related Forum Threads
Equity to Symbol - AMM / Script
Adjust the Entry and exit prices of trades in AMM script
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
Ranking system calculation methods
QuantShare Trading Software: New Features in the 3.3.1 Version
4 Links to Download Free Historical Stock Prices Data by Date
Different Types of Trading Indicators: Trend, Momentum, Volatilit...









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.