setprofittarget and setstoploss not working  [SOLVED]

Questions about MultiCharts and user contributed studies.
nolantx

setprofittarget and setstoploss not working

Postby nolantx » 15 Jan 2007

In all the code I have imported from TS, the functions "setprofittarget" and "setstoploss" do not work. Any help would be greatly appreciated, below is the code causing the problem:

Inputs: PositionBasis(false), StopAmount(150), ProfitAmount(50);

If PositionBasis Then
SetStopPosition
Else
SetStopContract;

SetStopLoss(StopAmount);
SetProfitTarget(ProfitAmount);

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 17 Jan 2007

These "setprofittarget" and "setstoploss" functions will work in the next version that most likely will be released this week.

FXXX
Posts: 9
Joined: 26 Feb 2007
Been thanked: 3 times

Postby FXXX » 26 Feb 2007

These "setprofittarget" and "setstoploss" functions will work in the next version that most likely will be released this week.


I have just downloaded the latest build, and still SetprofitTarget and SetStopLoss are not working. Is this true, or I have done something wrong?

momentum
Posts: 318
Joined: 23 Nov 2005
Has thanked: 8 times
Been thanked: 14 times

Postby momentum » 26 Feb 2007

They are working for me OK. Have you set up the correct numbers in Quotemanager?

FXXX
Posts: 9
Joined: 26 Feb 2007
Been thanked: 3 times

Postby FXXX » 26 Feb 2007

They are working for me OK. Have you set up the correct numbers in Quotemanager?


Well just found out that the amount has to be set in pips, not in currency as is in TS.

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

  [SOLVED]

Postby Kate » 26 Feb 2007

They work similar to TS8 functions.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Using setstoploss with IB

Postby aljafp » 01 May 2008

hi
Are stops generated by setstoploss sent to IB or keep on our pc ?

IF we do a SAR do we need to cancel the stop loss orders ?

thanks

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Re: Using setstoploss with IB

Postby Marina Pashkova » 06 May 2008

hi
Are stops generated by setstoploss sent to IB or keep on our pc ?


They are sent to IB as any other stop orders.

IF we do a SAR do we need to cancel the stop loss orders ?

thanks


SAR and stop loss are mutually exclusive.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Re: Using setstoploss with IB

Postby aljafp » 06 May 2008

hi
Are stops generated by setstoploss sent to IB or keep on our pc ?


They are sent to IB as any other stop orders.

IF we do a SAR do we need to cancel the stop loss orders ?

thanks


SAR and stop loss are mutually exclusive.


So say i perform the following sequence
1. Buy
2. setStopLoss ( a sell stop would be send to IB right ? )
3. SellShort
4. setStopLoss ( a buy stop would be send to IB right ? )

At which point is the sell StopLoss at 2 that was send to IB canceled ?
Is it canceled automatically when i do a SellShort at 3 ?
Or do i have to cancel it first ? if i have to cancel it first what is the syntax ?

thanks

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 08 May 2008

Hi aljafp,

The information above is not enough to answer your question. Could you post an excerpt from the code? Or you could send it to my e-mail: mpashkova@tssupport.com

Thank you.

aljafp
Posts: 184
Joined: 28 Oct 2005
Been thanked: 1 time

Postby aljafp » 08 May 2008

Hi aljafp,

The information above is not enough to answer your question. Could you post an excerpt from the code? Or you could send it to my e-mail: mpashkova@tssupport.com

Thank you.


hi marina, have send you an email, but just in case you didn't get it,
here's the code:

variables: intrabarpersist currentBuyBar(0),
intrabarpersist currentSellBar(0);

if high>=highest(high,3)[1] and currentBuyBar<>currentBar then begin
Buy 1 shares next bar at market;
setstoploss(500);
currentBuyBar=currentBar;
end;


if low<=lowest(low,3)[1] and currentSellBar<>currentBar then begin
sellshort 1 shares next bar at market;
setstoploss(500) ;
currentSellBar=currentBar;
end

/*
Say the first condition is satisfied and i now have a long position with
a sell stoploss send to IB.

If the second condition is now satisfied, at which point is the first
sell stop loss cancelled ?

thanks

*/

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 13 May 2008

Hi aljafp,

Let me know if the explanation I e-mailed to you is enough.

Regards.


Return to “MultiCharts”