Discretinary Stop Indicator

Questions about MultiCharts and user contributed studies.
aczk
Posts: 71
Joined: 08 Feb 2012
Has thanked: 8 times
Been thanked: 1 time

Discretinary Stop Indicator

Postby aczk » 25 Feb 2013

Hi All

Wonder if it is possible to plot a simple stop only when I have a position in discretionary trading.

May attempted code below dows not work and I have tried many other variations. Appreciate any help at this point

Code: Select all

inputs: PointStop(10);
vars: PointStopVar(0);


if i_MarketPosition_at_Broker = 1 then begin
PointStopVar = i_AvgEntryPrice_at_Broker - PointStop;
plot1(PointStop,"PointStopforLong");
end;
Thanks

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Discretinary Stop Indicator

Postby JoshM » 26 Feb 2013

Wonder if it is possible to plot a simple stop only when I have a position in discretionary trading.

May attempted code below dows not work and I have tried many other variations. Appreciate any help at this point.
I wonder why you want to do that. Looking at your code, you want to plot a horizontal line with the price value of the stop, correct? The discretionary Chart Trading can already do such a thing.

aczk
Posts: 71
Joined: 08 Feb 2012
Has thanked: 8 times
Been thanked: 1 time

Re: Discretinary Stop Indicator

Postby aczk » 26 Feb 2013

Yes correct, but I want to do it automatically with an indicator. The point stop is just for starters, I am looking to create volatility, ATR etc type stops for discretionary trading that plot stop price line once a position is on.

Thanks

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Discretinary Stop Indicator

Postby JoshM » 26 Feb 2013

Yes correct, but I want to do it automatically with an indicator. The point stop is just for starters, I am looking to create volatility, ATR etc type stops for discretionary trading that plot stop price line once a position is on.
Ah I see. If you do this in an indicator, then you know that you can't automatically submit these orders? This might give you additional slippage, especially in volatile markets, and you can't take a short break when you have a position on since you'll manually need to submit those 'soft' stop-loss orders.

That being said, you can adjust your code to something like this:

Code: Select all

Variables:
stopPrice(0);

if (i_MarketPosition_at_Broker > 0) then begin

// Long stop-loss calculation

end

else if (i_MarketPosition_at_Broker < 0) then begin

// Short stop loss calculation

end;

Plot1(stopPrice, "MyStop");
(Edit: You may need to use a loop to plot the horizontal line for the previous bars instead of only on the current bar.)

But keep in mind that:
A zero ('0') is returned when the current position is flat, or if Automated Trading is not turned on.
Source.

aczk
Posts: 71
Joined: 08 Feb 2012
Has thanked: 8 times
Been thanked: 1 time

Re: Discretinary Stop Indicator

Postby aczk » 01 Mar 2013

That does not seem to work. Which comand actually tells you whether a position is on or not?

escamillo
Posts: 203
Joined: 25 Mar 2011
Has thanked: 23 times
Been thanked: 56 times

Re: Discretinary Stop Indicator

Postby escamillo » 01 Mar 2013

!
Last edited by escamillo on 17 Nov 2014, edited 1 time in total.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Discretinary Stop Indicator

Postby Andrew MultiCharts » 06 Mar 2013

Please read about combining automated trading with manual trading in MultiCharts, it should be helpful for you.


Return to “MultiCharts”