SetProfitTarget Function

Questions about MultiCharts and user contributed studies.
Gann_Man
Posts: 74
Joined: 01 Jul 2007
Has thanked: 4 times
Been thanked: 1 time

SetProfitTarget Function

Postby Gann_Man » 22 Jul 2011

Anybody else having problems with the "SetProfitTarget" function?

{profit target code snippet}

variable: profitTarget(0), targetPrice(0);


{The profit target function is "NOT" 100% accurate "ALL" of the time}

SetProfitTarget(profitTarget);



{This profit target code is 100% accurate "ALL" of the time}

If MarketPosition < 0 Then targetPrice = EntryPrice - profitTarget / BigPointValue;

If MarketPosition > 0 Then targetPrice = EntryPrice + profitTarget / BigPointValue;

User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 154 times
Been thanked: 215 times

Re: SetProfitTarget Function

Postby furytrader » 22 Jul 2011

Can you give an example where it's not accurate? I've used it both in backtesting and in real-time trading and it's always worked for me. I don't do automated trading though, but in terms of showing at which price I should exit the market, it's worked just fine.

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Re: SetProfitTarget Function

Postby TJ » 23 Jul 2011

Gann_Man wrote:Anybody else having problems with the "SetProfitTarget" function?

{profit target code snippet}

variable: profitTarget(0), targetPrice(0);


{The profit target function is "NOT" 100% accurate "ALL" of the time}

SetProfitTarget(profitTarget);



{This profit target code is 100% accurate "ALL" of the time}

If MarketPosition < 0 Then targetPrice = EntryPrice - profitTarget / BigPointValue;

If MarketPosition > 0 Then targetPrice = EntryPrice + profitTarget / BigPointValue;


see post #3
viewtopic.php?f=16&t=6929
These users thanked the author TJ for the post (total 2):
Gann_ManStan Bokov

Gann_Man
Posts: 74
Joined: 01 Jul 2007
Has thanked: 4 times
Been thanked: 1 time

Re: SetProfitTarget Function

Postby Gann_Man » 23 Jul 2011

TJ wrote:
Gann_Man wrote:Anybody else having problems with the "SetProfitTarget" function?

{profit target code snippet}

variable: profitTarget(0), targetPrice(0);


{The profit target function is "NOT" 100% accurate "ALL" of the time}

SetProfitTarget(profitTarget);



{This profit target code is 100% accurate "ALL" of the time}

If MarketPosition < 0 Then targetPrice = EntryPrice - profitTarget / BigPointValue;

If MarketPosition > 0 Then targetPrice = EntryPrice + profitTarget / BigPointValue;


see post #3
viewtopic.php?f=16&t=6929


Thanks TJ, I DID have SetProfitTarget nested which was probably causing the problems. Can't verify for sure yet because QuoteManager deleted ALL of my tick data from the database. I did a Symbol Mapping of chart symbol ES #F to broker symbol ESU1 which caused my entire ES #F tick history to be deleted.


Return to “MultiCharts”