How to manage different setup in the same signal program

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

How to manage different setup in the same signal program

Postby arjfca » 03 Feb 2011

Hello

My signal program is designed arround 4 differents setups + a special condition
When one of these condition is met, an order to go long or short is issued.

Now, for the special condition, I would like to use a different stop management rule.

Since conditions in my system rely on having a position or not, I'm looking at the MarketPosition value in the process.

MarketPosition will equal 1 for any long position that would had been issued for any setup.

My big interogation, how could i know witch setup i have to control if i want to apply different rules to it.
At the beginning of each bar, all variables are reseted

Is it possible to have position name like "Long1" and "Long2" and read the presence of them in the account?

Hope I'm clear ennough
Martin

janus
Posts: 835
Joined: 25 May 2009
Has thanked: 63 times
Been thanked: 104 times

Re: How to manage different setup in the same signal program

Postby janus » 03 Feb 2011

Not sure what you mean by "read the presence of them in the account". If you mean can you track the orders separately at the broker end from the study to check their status and know if they are in profit or loss then no, not out of the box. A workaround is as follows.

You can use the "EntryLabel" parameter to associate separate exit orders with multiple entry orders - see documentation. You have to be aware of a few issues. You can't place multiple entry orders (with different labels) at the same time. You can overcome this by spreading them over successive tick updates (so you need to turn on IOG to be more responsive to the markets) - a pain and not exactly the same but is workable and should be close enough most of the time. Another issue is when you need to set limit or stop orders to two or more of the entries - not sure but may have the same issue as above. There's also the issue of not knowing from the study which one is hit. The workaround is to make some assumptions and use MarketPosition_at_Broker when auto execution is enabled or MarketPosition*currentcontracts when it's not, and track the market price relative to the levels specified in your exit orders to determine which one was most likely hit; but there is no guarantee it will be correct 100% of the time, especially in volatile markets.

I haven't investigated all this thoroughly so it all needs to be verified.


Return to “MultiCharts”