Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
i need to create a function MarketPosition in Amibroker, just like the one in MultiCharts. description in MultiCharts:
MarketPosition(N) returns whether the strategy is currently flat, short, or long on the current bar or for
N closed positions ago. MarketPosition return values are:
-1 for a short position.
1 for a long position.
0 for flat (no position).
I want to create same kind of function in Amibroker, but not good enough at coding.
Can somebody please help me do this.
Can you help answer these questions from other members on NexusFi?
This thread is old, but it's a classic so I answer it as it could be useful for other people.
Use the Flip() function. In the following I assume you have defined your system using variables Buy/Sell/Short/Cover.
If one of them is not defined, assign 0 to it e.g if you have no short position: