Skip to content

Quick-tip 12 | Multiple output function

I had a question as to where were variables being set when using a multiple output function. This quick-tip seeks to answer this question.

EasyLanguage multiple output function video

Quick-tips 12 indicator

{ THIS INDICATOR IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE,
RESULTING FROM THE USE OF THIS INFORMATION, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION IS AT YOUR OWN RISK.
THIS INDICATOR AND ASSOCIATED TECHNIQUES IS AN EXAMPLE ONLY, AND HAS BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION DOES NOT RECOMMEND
THAT YOU USE ANY SUCH TRADING STRATEGIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS
(OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF THIS INDICATOR DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES. }

Variables: double oHighLowNum( 0 ),
double oOpenCloseAv( 0 ),

string oRetMessage( "" );

// Call the _QuickTips12 function
// Inputs are H, L, 2, and " Indicator calling function "
// Outputs are returned to oHighLowNum, oOpenCloseAv, oRetMessage
Value1 = _QuickTips12( H, L, 2, " Indicator calling function ", oHighLowNum, oOpenCloseAv, oRetMessage );

// Plot the oHighLowNum and oOpenCloseAv outputs
Plot1( oHighLowNum, "HLAv", Red );
Plot2( oOpenCloseAv, "OCAv", Green );

// Print the output message
Print( Value1, " ", D, " ", T, oRetMessage );

{ ** Copyright (c) 2017 Markplex Corporation. All rights reserved. **
** Markplex Corporation reserves the right to modify or overwrite this analysis technique on its https://markplex.com Web site. ** }

Quick-tips 12 function

{ THIS FUNCTION IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES,
DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS.
USE OF THIS INFORMATION IS AT YOUR OWN RISK. THIS FUNCTION AND ASSOCIATED TECHNIQUES IS AN EXAMPLE ONLY, AND HAS BEEN INCLUDED
SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, INDICATORS, SHOWME
STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES.
THE USE OF THIS FUNCTION DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES. }

Input: // Inputs
double PriceH( numericseries ), // Numeric series input
double PriceL( numericseries ), // Numeric series input

int Denom( numericsimple ), // Numeric simple expression with no history available

string Message( stringsimple ), // String simple expression with no history available

// Outputs
double oHLNum( NumericRef ), // Numeric output
double oOCAv( NumericRef ), // Numeric output
string oMessage( StringRef ); // String output

oHLNum = ( PriceH + PriceL ) / Denom; // Calculates the sum of the price inputs divided by the Denom input
oOCAv = AvgList( O, C ); // Calculates the average of open and close
oMessage = " String returned from " + Message ; // Adds a string before the sting input

_QuickTips12 = T; // The function returns another value, arbitrarily set to the time value

{ ** Copyright (c) 2017 Markplex Corporation. All rights reserved. **
** Markplex Corporation reserves the right to modify or overwrite this analysis technique on its https://markplex.com Web site. ** }