I have seen some language has "ExitName" reserved word.
It is used like, for example,
If marketposition <> 0 Then begin
Sell ("LX1") Next bar at EntryPrice+10 stop;
Sell ("LX2") Next bar at EntryPrice+20 stop;
BuyToCover ("SX1") Next bar at EntryPrice-10 stop;
BuyToCover ("SX2") Next bar at EntryPrice-20 stop;
End;
If marketposition=0 And marketposition(1)=1 And exitname(1)="LX1" Then
sellShort ("SE1") 5 contracts next bar at market;
If marketposition=0 And marketposition(1)=1 And exitname(1)="LX2" Then
sellShort ("SE2") 10 contracts next bar at market;
If marketposition=0 And marketposition(1)=-1 And exitname(1)="SX1" Then
Buy("LE1") 5 contracts next bar at market;
If marketposition=0 And marketposition(1)=-1 And exitname(1)="SX2" Then
Buy("LE2") 10 contracts next bar at market;
Unfortunately, EasyLanguage does not have ExitName or like.
Can anyone tell me how to emulate "ExitName" using EasyLanguage?
Thanks.
How to emulate "ExitName"?
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: How to emulate "ExitName"?
This is really a long-waited feature.
TSS please confirm this is officially supported built-in function and provide a complete documentation.
TSS please confirm this is officially supported built-in function and provide a complete documentation.
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: How to emulate "ExitName"?
Hi Guys,
Exitname/Entryname keywords are officially supported in MultiCharts release of 6.0.
Entryname/exitname are available for signals only. Entryname allows to get name of orders that open last position and Exitname is used to get name of orders that close last position.
Thank you
Exitname/Entryname keywords are officially supported in MultiCharts release of 6.0.
Entryname/exitname are available for signals only. Entryname allows to get name of orders that open last position and Exitname is used to get name of orders that close last position.
Thank you
Re: How to emulate "ExitName"?
Thanks Anastassia. Entryname appears to work but Exitname appears to print blank always. However, the entry and exit signal names appears correctly on the chart. The following signal study demonstrate this:
Code: Select all
[IntrabarOrderGeneration = True]
variables:
intrabarpersist counter(0);
if LastBarOnChart_s then begin
print ("entryname:", entryname);
print ("exitname:", exitname);
once buy ("LONG") 2 contracts next bar at market; // once off buy order on next tick update
counter = counter + 1;
print (counter);
if counter = 5 then sell ("COVER") all contracts next bar at market; // cover all after a few ticks
end;
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: How to emulate "ExitName"?
Hi Janus,
ExitName(PosBack)
Where: PosBack - a numerical expression, specifying the position:
0 - open position;
1 - one position back (the last position closed);
2 - two positions back, etc.
If PosBack is not specified, a value for the open position will be returned.
Since you use Exitname without parameters in your script, the exit name for open position will be returned (If PosBack is not specified, a value for the open position will be returned).
So it will "print blank" because the position is still opened (there hasn't been exit yet).
Most likely you wanted exit name for the last closed position (the last position closed).
If so, use ExitName(1) instead of ExitName
Thank you
Entryname appears to work but Exitname appears to print blank always.
ExitName(PosBack)
Where: PosBack - a numerical expression, specifying the position:
0 - open position;
1 - one position back (the last position closed);
2 - two positions back, etc.
If PosBack is not specified, a value for the open position will be returned.
Since you use Exitname without parameters in your script, the exit name for open position will be returned (If PosBack is not specified, a value for the open position will be returned).
So it will "print blank" because the position is still opened (there hasn't been exit yet).
Most likely you wanted exit name for the last closed position (the last position closed).
If so, use ExitName(1) instead of ExitName
Thank you