Setting dynamic order name

From MultiCharts
Jump to navigation Jump to search

Dynamic order name feature has been introduced in MultiCharts 8.8 beta 1.

Now it is possible to generate the order name basing on script calculation.

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;
Notes:
  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.
  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.