Problem with incorrect entryprice identification.

Questions about MultiCharts and user contributed studies.
treksis
Posts: 13
Joined: 18 Jul 2014
Has thanked: 4 times

Problem with incorrect entryprice identification.

Postby treksis » 03 Aug 2014

I have 2 strategies running at the same time.
First strategy buys only on the whole number and the second one buys only if close finishes with x.50$. Hence, I have 2 entryprices, one at 11$ and the other at 10.5$.(for example)

The main problem here is when I want to sell at 1$ profit. The system recognizes 1$ profit on the 11$ entryprice, but not on the 10.5$. It will sell both shares at the same time when close > 12$. I want to be able to sell at 11.5$ for the one I bought at 10.5$.

Code: Select all

if close>IntPortion(close)+0.01 and close<Intportion(close)+0.99 then
buy ("buy") next bar at IntPortion(close) limit;

if close > entryprice+1 then
sell ("1$") this bar on close;

Code: Select all

if close>IntPortion(close)+0.51 and close<Intportion(close)+0.99 then
buy ("buy_50") next bar at IntPortion(close)+0.5 limit;

if close > entryprice+1 then
sell ("1$!") this bar on close;
How can I bound the entryprices to its strategy?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Problem with incorrect entryprice identification.

Postby Henry MultiСharts » 04 Aug 2014

Hello treksis,

You can get the execution price of each individual entry order with the help of PosTradeEntryPrice.


Return to “MultiCharts”