Setting dynamic order name
From MultiCharts
It is possible to specify the order name in the script.
The types of available order naming algorithms
- Order with automatically generated names
buy next bar market;
- Order with pre-set static order name
buy("My Buy") next bar market;
- Order with sting variable name
Var: NLong("Long ");
NLong = NLong + NumToStr(currentbar, 0);
buy(NLong) next bar market;
- Order with string sentense name
Var: NLong("Long ");
NLong = NLong + NumToStr(currentbar, 0);
buy(NLong + " Limit") next bar с limit;
- Order with compound sentence name
Var: NLong("Long ");
NLong = NLo`ng + NumToStr(currentbar, 0);
buy (NLong + " at " + NumToStr(c, 2) + " Limit") next bar c limit;
- Exit From Entry structure
Var: Nl("Long ");
buy (Nl + "Entry") 5 shares next bar c limit;
sell (Nl + "SL Exit" + " Low bar") from Entry(Nl + "Entry") next bar l stop;
Note 1
It is not possible to give an order the name that has already been used for another line of script. It will make a study be turned off.Note 2
Make sure that appropriate names are used for "Exit From Entry" logic. If there's no any order with the set name - position won't be closed.