Hi all,
is it possible to see on the chart the price level of the stop line as stop signal below?
__________________________________________________________________________________
Inputs: Label1("Stop fisso punti"),
StopLossAmt( 40 ),
Label3("Disegna Linea"),
PlotLinea (TRUE),
ColoreLinea(magenta),
ShowDebug(false);
Vars:
EP(0), //entryprice
StopLong (0), //trailing
StopShort(0), //trailing
LineaLongStop (0), //trailing
LineaShortStop(0), //trailing
MyDate(0); //debug
{COSTRUZIONE DEL TRAILING -}
EP=entryprice;
StopLong=l-StopLossAmt;
StopShort=h+StopLossAmt;
//LONG stop
If marketposition=1 then begin
StopLong=Maxlist(StopLong[1],c-StopLossAmt,EP-StopLossAmt);
If L < StopLong then begin
Sell ("LNGSTOP") next bar at Open;
end;
If PlotLinea then begin
LineaLongStop = TL_New( D, T, StopLong, D[1], T[1], StopLong[1]);
Tl_setcolor(LineaLongStop, ColoreLinea);
End;
End;
_____________________________________________________________________________________
Tnx.
Show Custom Stop Price on chart
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Show Custom Stop Price on chart
Hello Wapi,
Your strategy should open a position first, then the code you have provided above will plot the line for the stop order.
Your strategy should open a position first, then the code you have provided above will plot the line for the stop order.
Re: Show Custom Stop Price on chart
TJ: sry for not tagging the code
Henry: yes, this code is to be placed in a strategy where another signal open a position and
yes, the code plot the line for the stop order.
I'd like to know if it's possible to see the price of the stop order plotted on the right side of the chart like the prebuild "setstoploss(StopLossAmt) " do.
Code: Select all
Inputs: Label1("Stop fisso punti"),
StopLossAmt( 40 ),
Label3("Disegna Linea"),
PlotLinea (TRUE),
ColoreLinea(magenta),
ShowDebug(false);
Vars:
EP(0), //entryprice
StopLong (0), //trailing
StopShort(0), //trailing
LineaLongStop (0), //trailing
LineaShortStop(0), //trailing
MyDate(0); //debug
{COSTRUZIONE DEL TRAILING -}
EP=entryprice;
StopLong=l-StopLossAmt;
StopShort=h+StopLossAmt;
//LONG stop
If marketposition=1 then begin
StopLong=Maxlist(StopLong[1],c-StopLossAmt,EP-StopLossAmt);
If L < StopLong then begin
Sell ("LNGSTOP") next bar at Open;
end;
If PlotLinea then begin
LineaLongStop = TL_New( D, T, StopLong, D[1], T[1], StopLong[1]);
Tl_setcolor(LineaLongStop, ColoreLinea);
End;
End;
yes, the code plot the line for the stop order.
I'd like to know if it's possible to see the price of the stop order plotted on the right side of the chart like the prebuild "setstoploss(StopLossAmt) " do.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Show Custom Stop Price on chart
Hello Wapi,
That is possible to program a code that will plot a line at the order price level at the desired position, but the code you have provided above is not designed to do that.
That is possible to program a code that will plot a line at the order price level at the desired position, but the code you have provided above is not designed to do that.
Re: Show Custom Stop Price on chart
Referring to the prebuild "setstoploss" I was not clear in what i'm looking for :
I see the line of the stop order. Can I plot the price of the stop on the right of the line ?
Can I plot the level of the stop as text ?
I see the line of the stop order. Can I plot the price of the stop on the right of the line ?
Can I plot the level of the stop as text ?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Show Custom Stop Price on chart
Wapi,
Your code can place Text drawings on the chart:
https://www.multicharts.com/trading-sof ... xt_Drawing
Your code can place Text drawings on the chart:
https://www.multicharts.com/trading-sof ... xt_Drawing