×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

PMM Keywords

1,671 bytes added, 11:58, 14 February 2023
no edit summary
Please note that all keywords returning or receiveing money values are using the currency specified in the Portfolio settings '''(View -> Portfolio Settings -> Base Currency).'''
'''[[pmms_strategies_count]]()''' – number of trading strategies (equal to the number of downloaded instruments that are traded). <br>
'''[[pmms_strategies_in_positions_count]]( indexes[] )''' – the number of strategies with an open position; this value will be held in an array. <br>
'''[[pmms_strategies_pause_all]]()''' – pause all strategies in the portfolio from sending orders. <br>
'''[[pmms_strategies_deny_entries_all]]()''' – deny all strategies to open positions (entry orders will be excluded from the RAW orders collection). <br>
'''[[pmms_strategies_set_status_for_all]]( stirng string )''' – set a text (string) status for all the portfolio’s strategies (status is indicated in the “Status” “Custom Text” column of Portfolio Real-Time Window). <br>
'''[[pmms_get_strategy_named_num]]( idx, var_name )''' – get a numerical value of var_name of the strategy with an idx number. <br>
'''[[pmms_get_strategy_named_str]]( idx,var_name )''' – get string value of var_name of the strategy with an idx number. <br>
'''[[pmms_set_strategy_named_num ]]( idx, var_name, var_val )''' – set a numerical value of var_name of the strategy with an idx number. <br>
'''[[pmms_set_strategy_named_str]]( idx, var_name, str_val )''' – set a string value of var_name of the strategy with an idx number. <br>
'''[[pmms_strategy_close_position]](idx)''' – close a strategy position with an idx number with market order (orders generated by the strategy will be deleted from Raw Orders collection). <br>
'''pmms_strategy_set_entry_contracts[[pmms_strategy_close_position_partial]](idx, isNextBar, contracts)''' – set the number partially close position of contracts for the strategy’s entry with an idx number (size calculated by the specified strategy itself will be ignored). To use the order size calculated by for the strategy itself set “contracts” parameter to 0number of contracts. <br>
'''pmms_strategy_get_entry_contracts[[pmms_strategy_set_entry_contracts]](idx, contracts)''' – get set the number of contracts of for the strategy’s entry order of the strategy with an idx number(size calculated by the strategy itself will be ignored). To use the order size calculated by the strategy itself set “contracts” parameter to -1. <br>
'''pmms_strategy_allow_entries[[pmms_strategy_get_entry_contracts]](idx)''' – allow get the number of contracts of the entry orders for a order of the strategy with an idx number. <br>
'''pmms_strategy_deny_entries[[pmms_strategy_allow_entries]](idx)''' – deny allow entry orders for a strategy with an idx number (entry orders will be deleted from Raw Orders collection). <br>
'''pmms_strategy_is_paused[[pmms_strategy_allow_long_entries]](idx)''' – returns TRUE if order sending is paused the same as pmms_strategy_allow_entries, but applied for the strategy with an idx numberlong entries only. <br>
'''pmms_strategy_pause[[pmms_strategy_allow_short_entries]](idx)''' – deny order sending the same as pmms_strategy_allow_entries, but applied for the strategy with an idx number (all strategy’s orders will be deleted from Raw Orders Collection) pmms_strategy_resume(idx) – allow order sending with an idx numbershort entries only. <br>
'''pmms_strategy_set_status[[pmms_strategy_deny_entries]](idx, str_val)''' – set the text (string) status deny entry orders for the a strategy with an idx number (the status entry orders will be indicated in the “Status” column of Portfolio Real-Time Windowdeleted from Raw Orders collection). <br>
'''pmms_strategy_marketposition[[pmms_strategy_is_paused]](idx)''' – returns a numerical value representing TRUE if order sending is paused for the strategy’s market position strategy with an idx number. <br>
'''pmms_strategy_netprofit[[pmms_strategy_pause]](idx)''' – returns a numerical value representing the net profit of deny order sending for the strategy with an idx number (all strategy’s orders will be deleted from Raw Orders Collection) pmms_strategy_resume(idx) – allow order sending with an idx number. <br>
'''pmms_strategy_openprofit[[pmms_strategy_set_status]](idx, str_val)''' – returns a numerical value representing set the unrealized profit/loss of text (string) status for the strategy with an idx number(the status will be indicated in the “Custom Text” column of Portfolio Real-Time Window). <br>
'''pmms_strategy_maxiddrawdown[[pmms_strategy_marketposition]](idx)''' – returns a numerical value representing the max drawdown of the strategy strategy’s market position with an idx number. <br>
'''pmms_strategy_currentcontracts[[pmms_Strategy_NetProfit]](idx)''' – returns a numerical value representing a positions’ number the net profit of contracts which was opened by the strategy with an idx number. <br>
'''pmms_strategy_entryprice[[pmms_Strategy_OpenProfit]](idx)''' – returns a numerical value representing an average entry price the unrealized profit/loss of the position opened by the strategy with an idx number. <br>
'''pmms_strategy_riskcapital[[pmms_Strategy_Maxiddrawdown]](idx)''' – returns a numerical value representing the amount of money withheld as a risk capital for the open position max drawdown of the strategy with an idx number. <br>
'''pmms_strategy_symbol[[pmms_strategy_currentcontracts]](idx)''' – returns a string value representing the name a positions’ number of the instrument to contracts which was opened by the signal is appliedstrategy with an idx number. <br>
'''pmms_strategies_get_by_symbol_name[[pmms_strategy_entryprice]](symbolidx)''' – returns a numerical value, indicating the strategy’s based on an instrument name (-1, if price at the instrument is not found). If several strategies are applied to initial entry into the same instrument, then specified position opened by the strategy with StrategyIndex number of one of these strategies will be returned. <br>
'''pmm_set_my_status[[pmms_Strategy_RiskCapital]](str_validx)''' – set returns a numerical value representing the text (string) status amount of money withheld as a risk capital for the current open position of the strategy (visible in Status column of Portfolio Real-time window)with an idx number. <br>
'''pmm_get_my_named_num[[pmms_strategy_symbol]](var_nameidx)''' – get returns a string value representing the numerical value name of var_name variablethe instrument to which the signal is applied. <br>
'''pmm_get_my_named_str[[pmms_strategies_get_by_symbol_name]](var_namesymbol)''' – get returns the string value strategy’s based on an instrument name (-1, if the instrument is not found). If several strategies are applied to the same instrument, then the number of one of var_name variablethese strategies will be returned. <br>
'''pmm_set_my_named_num[[pmm_set_my_status]](var_name, valstr_val)''' – set the numerical value “val” text (string) status for var_name variablethe current strategy (visible in the “Custom Text” column of Portfolio Real-time window). <br>
'''pmm_set_my_named_str[[pmm_get_my_named_num]](var_name, str_val)''' – set get the string numerical value “str_val” for of var_name variable. <br>
'''pmm_get_global_named_num[[pmm_get_my_named_str]](var_name)''' – get the string value of global numerical var_name variable (visible by all strategies). <br>
'''pmm_get_global_named_str[[pmm_set_my_named_num]](var_name, val)''' – get set the numerical value of global string “val” for var_name variable (visible by all strategies). <br>
'''pmm_set_global_named_num[[pmm_set_my_named_str]](var_name, valstr_val)''' – set the string value of global numerical “str_val” for var_name variable. <br>
'''pmm_set_global_named_str[[pmm_get_global_named_num]](var_name, val)''' – set get the value of global string numerical var_name variable(visible by all strategies). <br>
'''convert_currency[[pmm_get_global_named_str]](datetime, currencyCode1, currencyCode2, moneyValuevar_name)''' – moneyValue is a get the value conversion from the currency designated currencycode1, into the currency with currencycode2, using the rate at the datetime moment. For example, convert_currencyof global string var_name variable (datetime, codeEUR, codeJPY, 500visible by all strategies) will convert 500 EUR value to Japanese Yens using the rate at the moment of calculation at the current bar. <br>
'''currencyCodeToStr[[pmm_set_global_named_num]](currencyCodevar_name, val)''' – string value for set the currency with currencyCode code. For example, currencycodetostr(symbolcurrencycode) will return “EUR” value, if the strategy is calculated using the symbol with EUR as a basic currencyof global numerical var_name variable. <br>
'''symbolCurrencyCode [[pmm_set_global_named_str]](var_name, val)'''– returns currency code set the value of the current symbolglobal string var_name variable. <br>
'''portfolio_CurrencyCode[[pmm_get_my_index]]''' - returns a numerical value, indicating zero-based index of the currency code used for the Portfolio’s current trading strategy calculation. <br>
'''array_contains(realArr[[convert_currency]](datetime, valuecurrencyCode1, currencyCode2, moneyValue)''' – allows moneyValue is a value conversion from the currency designated currencycode1, into the user currency with currencycode2, using the rate at the datetime moment. For example, convert_currency(datetime, codeEUR, codeJPY, 500) will convert 500 EUR value to check if Japanese Yens using the rate at the value moment of calculation at the parameter “value” is contained in the realArr arraycurrent bar. <br>
'''[[currencyCodeToStr]](currencyCode)''' – string value for the currency with currencyCode code. For example, currencycodetostr(symbolcurrencycode) will return “EUR” value, if the strategy is calculated using the symbol with EUR as a basic currency. <br> '''[[symbolCurrencyCode]] '''– returns currency code of the current symbol. <br> '''[[portfolio_CurrencyCode]]''' – returns the currency code used for the Portfolio’s strategy calculation. <br> '''[[array_contains]](realArr[], value)''' – allows the user to check if the value of the parameter “value” is contained in the realArr array. <br> '''[[array_contains]](stringArr[], stringVal)''' – allows the user to check if stringVal value is contained in stringArr array. <br> '''[[array_contains]](boolArr[], boolVal)''' – allows the user to check if boolVal value is contained in boolArr array. <br> == PMM Keywords Understanding: “pmm_set” & “pmm_get” == Portfolio has one strategy (Strategy 1) which consists of 2 signals: '''Custom_1''' and '''Custom_2'''.Portfolio has 3 instruments: GOOG -1 Day, MSFT – 1 Day, CSCO – 1 Day.<br> Let’s say the strategy also uses second data stream for its calculation. <br> In this case we have 3 portfolio strategy objects (for each instrument in portfolio):# Strategy 1 (Custom_1 and Custom_2) calculates on GOOG – 1 Day (+ GOOG – 1 Minute as data2).# Strategy 1 (Custom_1 and Custom_2) calculates on MSFT – 1 Day (+ MSFT – 1 Minute as data2).# Strategy 1 (Custom_1 and Custom_2) calculates on CSCO – 1 Day (+ CSCO – 1 Minute as data2). <br>[[File:PMM Keywords.png]] '''Figure 1 (Portfolio Trader window)'''   [[File:PMM Keywords 2.png]] '''Figure 2 (Sequence diagram for portfolio keywords calculation example)'''
'''array_contains(boolArr[], boolVal)''' – allows the user to check if boolVal value is contained in boolArr array. <br>