powerlanguage keyword reference - multicharts · magenta margin market marketposition...

990
PowerLanguage Keyword Reference

Upload: others

Post on 22-Aug-2020

24 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PowerLanguage Keyword Reference

Page 2: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

KeywordAlphabeticalIndex

A-DE-NO-ST-Z

#BeginCmtry#Events#ReturnAAbortAboveAbsValueAgoAlertAlertEnabledAllAllowSendOrdersAlwaysAnAndArcTangentArrayArray_CompareArray_ContainsArray_CopyArray_GetBooleanValueArray_GetFloatValueArray_GetIntegerValueArray_GetMaxIndexArray_GetStringValueArray_GetTypeArray_IndexOfArray_SetBooleanValueArray_SetFloatValueArray_SetIntegerValue

2

Page 3: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetMaxIndexArray_SetStringValueArray_SetValRangeArray_SortArray_SumArraysArraySizeArrayStartAddrArw_Anchor_to_BarsArw_DeleteArw_Get_Anchor_to_BarsArw_GetActiveArw_GetBarNumberArw_GetColorArw_GetDateArw_GetDirectionArw_GetFirstArw_GetLockArw_GetNextArw_GetSizeArw_GetStyleArw_GetTextArw_GetTextAttributeArw_GetTextBGColorArw_GetTextColorArw_GetTextFontNameArw_GetTextSizeArw_GetTimeArw_GetTime_DTArw_GetTime_sArw_GetValArw_LockArw_NewArw_New_BNArw_New_DT

3

Page 4: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_sArw_New_selfARW_New_Self_BNArw_New_Self_DTArw_New_self_sArw_SetBarNumberArw_SetColorArw_SetLocationArw_SetLocation_BNArw_SetLocation_DTArw_SetLocation_sArw_SetSizeArw_SetStyleArw_SetTextArw_SetTextAttributeArw_SetTextBGColorArw_SetTextColorArw_SetTextFontNameArw_SetTextSizeAskSizeAtAtCommentaryBarAUDAutoSessionAvgBarsEvenTradeAvgBarsLosTradeAvgBarsWinTradeAvgEntryPriceAvgEntryPrice_at_BrokerAvgEntryPrice_at_Broker_for_The_StrategyAvgListBarBarIntervalBars

4

Page 5: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSinceEntryBarsSinceEntry_CheckedBarsSinceExitBarsSinceExit_CheckedBarStatusBarTypeBarType_exBasedBaseDataNumberBeginBelowBidSizeBigPointValueBlackBlueBoolBoxSizeBreakBuyBuyToCoverByByteCCADCallCancelAlertcaseCategoryCeilingChangeMarketPositionCharCheckAlertCheckCommentaryCHFClearDebug

5

Page 6: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ClearPrintLog

CloseCommandLineCommentaryCommentaryCLCommentaryEnabledCommissionComputerDateTimeContractContractProfitContractsConvert_CurrencyCosineCotangentCoverCrossCrossesCurrentBarCurrentContractsCurrentDataNumberCurrentDateCurrentEntriesCurrentOpenIntCurrentSharesCurrentTimeCurrentTime_sCyanDDailyCloseDailyHighDailyLimitDailyLowDailyOpenDailyVolume

6

Page 7: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkBlueDarkBrown

DarkCyanDarkGrayDarkGreenDarkMagentaDarkRedDarkYellowDataDataCompressionDateDateTimeDatetime_bar_updateDateTime2ELTimeDateTime2ELTime_sDateTimeToStringDateTimeToString_MsDateToJulianDateToStringDayDayFromDateTimeDayOfMonthDayOfWeekDayOfWeekFromDateTimeDaysDefaultDefineDLLFuncDescriptionDoesDOM_AskPriceDOM_AsksCountDOM_AskSizeDOM_BidPriceDOM_BidsCount

7

Page 8: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_BidSizeDOM_IsConnectedDouble

DoubleQuoteDownTicksDownToDWORD

8

Page 9: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

KeywordAlphabeticalIndex

A-DE-NO-ST-Z

El_DateStrEl_DateToDateTimeEL_TimeToDateTimeEL_TimeToDateTime_sELDateToDateTimeElseELTimeToDateTimeELTimeToDateTime_sEncodeDateEncodeTimeEndEntryEntryDateEntryDate_CheckedEntryDateTimeEntryDateTime_CheckedEntryNameEntryPriceEntryPrice_CheckedEntryTimeEntryTime_CheckedEURExchListedExecOffsetExitDateExitDate_CheckedExitDateTimeExitDateTime_CheckedExitName

9

Page 10: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitPriceExitPrice_CheckedExitTimeExitTime_CheckedExpirationDateExpirationDateFromVendorExpValueExternalFalseFileFileAppendFileDeleteFill_ArrayFloatFloorForFormatDateFormatTimefpcExactAccuracyfpcHighAccuracyfpcLowAccuracyfpcMedAccuracyfpcVeryHighAccuracyfpcVeryLowAccuracyFracPortionFridayFromGBPGetAccountGetAccountIDGetAppInfoGetBackgroundColorGetBValueGetCDRomDriveGetCountry

10

Page 11: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetCurrencyGetExchangeNameGetGValueGetNumAccountsGetNumPositionsGetPlotBGColorGetPlotColorGetPlotWidthGetPositionAveragePriceGetPositionOpenPLGetPositionQuantityGetPositionSymbolGetPositionTotalCostGetRTAccountEquityGetRTAccountNetWorthGetRTSymbolNameGetRTUnrealizedPLGetRValueGetStrategyNameGetSymbolNameGetUserIDGetUserNameGradientColorGreenGrossLossGrossProfitHHighHigherHKDHoursFromDateTimeIi_AvgEntryPricei_AvgEntryPrice_at_Broker

11

Page 12: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_AvgEntryPrice_at_Broker_for_The_Strategyi_ClosedEquityi_CurrentContractsi_CurrentSharesI_getplotvaluei_MarketPositioni_MarketPosition_at_Brokeri_MarketPosition_at_Broker_for_The_Strategyi_OpenEquityI_setplotvalueiEasyLanguageObjectIfIncMonthInitialCapitalInputInputsInsideAskInsideBidInStrIntInt64IntervalTypeIntervalType_exIntPortionIntraBarOrderGenerationIntraBarPersistIsJPYJulianToDateLLargestLosTradeLargestWinTradeLastLastCalcDateTimeLastCalcJDate

12

Page 13: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcMMTime

LastCalcmSTimeLastCalcSSTimeLeftStrLegacyColorToRGBLegacyColorValueLightGrayLimitLogLongLowLowerLowerStrLPBoolLPByteLPDoubleLPDWORDLPFloatLPIntLPLongLPSTRLPWORDMagentaMarginMarketMarketPositionMarketPosition_at_BrokerMarketPosition_at_Broker_for_The_StrategyMarketPosition_CheckedMaxBarsBackMaxBarsForwardMaxConsecLosersMaxConsecWinnersMaxContractProfit

13

Page 14: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContractProfit_CheckedMaxContracts

MaxContracts_CheckedMaxContractsHeldMaxEntriesMaxEntries_CheckedMaxIDDrawDownMaxListMaxList2MaxPositionLossMaxPositionLoss_CheckedMaxPositionProfitMaxPositionProfit_CheckedMaxPositionsAgoMaxSharesMaxShares_CheckedMaxSharesHeldMC_Arw_GetActiveMC_Text_GetActiveMC_TL_GetActiveMC_TL_NewMC_TL_New_BNMC_TL_New_DTMC_TL_New_SelfMC_TL_New_Self_BNMC_TL_New_Self_DTMessageLogMethodMidStrMillisecondsFromDateTimeMinListMinList2MinMoveMinutesFromDateTime

14

Page 15: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ModMondayMonth

MonthFromDateTimeMouseClickBarNumberMouseClickCtrlPressedMouseClickDataNumberMouseClickDateTimeMouseClickPriceMouseClickShiftPressedNegNetProfitNewLineNextNOKNoneNoPlotNotNthMaxListNthMinListNumericNumericArrayNumericArrayRefNumericRefNumericSeriesNumericSimpleNumEvenTradesNumLosTradesNumToStrNumWinTradesNZD

15

Page 16: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

KeywordAlphabeticalIndex

A-DE-NO-ST-Z

OOfOnOnCreateOnDestroyOpenOpenEntriesCountOpenEntryComissionOpenEntryContractsOpenEntryDateOpenEntryMaxProfitOpenEntryMaxProfitPerContractOpenEntryMinProfitOpenEntryMinProfitPerContractOpenEntryPriceOpenEntryProfitOpenEntryProfitPerContractOpenEntryTimeOpenIntOpenPositionProfitOptionTypeOrOverPercentProfitPlacePlaceMarketOrderPlaySoundPlotPlotPaintBar

16

Page 17: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotPBpmm_get_global_named_numpmm_get_global_named_strpmm_get_my_named_numpmm_get_my_named_strpmm_set_global_named_numpmm_set_global_named_strpmm_set_my_named_numpmm_set_my_named_strpmm_set_my_statuspmms_get_strategy_named_numpmms_get_strategy_named_strpmms_set_strategy_named_numpmms_set_strategy_named_strpmms_strategies_allow_entries_allpmms_strategies_countpmms_strategies_deny_entries_allpmms_strategies_get_by_symbol_namepmms_strategies_in_long_countpmms_strategies_in_positions_countpmms_strategies_in_short_countpmms_strategies_pause_allpmms_strategies_resume_allpmms_strategies_set_status_for_allpmms_strategy_allow_entriespmms_strategy_allow_exit_from_longpmms_strategy_allow_exit_from_shortpmms_strategy_allow_exitspmms_strategy_allow_long_entriespmms_strategy_allow_short_entriespmms_strategy_close_positionpmms_strategy_currentcontractspmms_strategy_deny_entriespmms_strategy_deny_exit_from_longpmms_strategy_deny_exit_from_short

17

Page 18: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_exitspmms_strategy_deny_long_entriespmms_strategy_deny_short_entriespmms_strategy_entrypricepmms_strategy_get_entry_contractspmms_strategy_is_pausedpmms_strategy_marketpositionpmms_strategy_maxiddrawdownpmms_strategy_netprofitpmms_strategy_openprofitpmms_strategy_pausepmms_strategy_resumepmms_strategy_riskcapitalpmms_strategy_set_entry_contractspmms_strategy_set_statuspmms_strategy_symbolPointPointsPointValuePortfolio_CalcMaxPotentialLossForEntryPortfolio_CurrencyCodePortfolio_CurrentEntriesPortfolio_GetMarginPerContractPortfolio_GetMaxPotentialLossPerContractPortfolio_GrossLossPortfolio_GrossProfitPortfolio_InvestedCapitalPortfolio_MaxIDDrawdownPortfolio_MaxOpenPositionPotentialLossPortfolio_MaxRiskEquityPerPosPercentPortfolio_NetProfitPortfolio_NumLossTradesPortfolio_NumWinTradesPortfolio_OpenPositionProfit

18

Page 19: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_PercentProfitPortfolio_SetMaxPotentialLossPerContractPortfolio_StrategyDrawdownPortfolio_TotalMaxRiskEquityPercentPortfolio_TotalTradesPortfolioEntriesPriorityPosPositionProfitPositionProfit_CheckedPosTradeCommissionPosTradeCountPosTradeEntryBarPosTradeEntryCategoryPosTradeEntryDateTimePosTradeEntryNamePosTradeEntryPricePosTradeExitBarPosTradeExitCategoryPosTradeExitDateTimePosTradeExitNamePosTradeExitPricePosTradeIsLongPosTradeIsOpenPosTradeProfitPosTradeSizePowerPrevClosePriceScalePrintProcessMouseEventsPutq_Askq_asksizeq_Bidq_bidsize

19

Page 20: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_BigPointValue

q_Dateq_ExchangeListedq_Lastq_OpenInterestq_PreviousCloseq_Timeq_Time_Dtq_Time_sq_TotalVolumeq_tradevolumeRaiseRunTimeErrorRandomRecalcLastBarAfterRecalcPersistReCalculateRedRegularSessionRevSizeRGBRGBToLegacyColorRightStrRoundRTSymbolRTSymbolNameSameExitFromOneEntryOnceSaturdayScrollToBarSecondsFromDateTimeSEKSelfSellSellShortSess1EndTime

20

Page 21: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess1FirstBarTimeSess1StartTime

Sess2EndTimeSess2FirstBarTimeSess2StartTimeSessionCountSessionCountMSSessionEndDaySessionEndDayMSSessionEndTimeSessionEndTimeMSSessionLastBarSessionStartDaySessionStartDayMSSessionStartTimeSessionStartTimeMSSetBreakEvenSetBreakEven_ptSetCustomFitnessValueSetDollarTrailingSetExitOnCloseSetFPCompareAccuracySetMaxBarsBackSetPercentTrailingSetPercentTrailing_ptSetPlotBGColorSetPlotColorSetPlotWidthSetProfitTargetSetProfitTarget_ptSetStopContractSetStopLossSetStopLoss_ptSetStopPosition

21

Page 22: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopShareSetTrailingStop_ptSGD

ShareSharesShortSignSineSlippageSpacesSquareSquareRootStopStrikeStringStringArrayStringArrayRefStringRefStringSeriesStringSimpleStringToDateStringToDateTimeStringToDTFormattedStringToTimeStrLenStrToNumSumListSundayswitchSymbolSymbol_CloseSymbol_CurrentBarSymbol_DateSymbol_DownTicks

22

Page 23: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_HighSymbol_LengthSymbol_LowSymbol_Open

Symbol_OpenIntSymbol_TickIDSymbol_TicksSymbol_TimeSymbol_Time_SSymbol_UpTicksSymbol_VolumeSymbolCurrencyCodeSymbolName

23

Page 24: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

KeywordAlphabeticalIndex

A-DE-NO-ST-Z

TTangentTextText_Anchor_to_BarsText_DeleteText_Get_Anchor_to_BarsText_GetActiveText_GetAttributeText_GetBarNumberText_GetBGColorText_GetBorderText_GetColorText_GetDateText_GetFirstText_GetFontNameText_GetHStyleText_GetLockText_GetNextText_GetSizeText_GetStringText_GetTimeText_GetTime_DTText_GetTime_sText_GetValueText_GetVStyleText_LockText_NewText_New_BNText_New_Dt

24

Page 25: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_sText_New_selfText_New_Self_BNText_New_Self_DTText_New_self_sText_SetAttributeText_SetBarNumberText_SetBGColorText_SetBorderText_SetColorText_SetFontNameText_SetLocationText_SetLocation_BNText_SetLocation_DTText_SetLocation_sText_SetSizeText_SetStringText_SetStyleThanTheThenThisThreadSafeThursdayTickIDTicksTimeTime_sTime_s2TimeTime2Time_sTimeToStringTL_Anchor_to_BarsTL_DeleteTL_Get_Anchor_to_BarsTL_GetActive

25

Page 26: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetAlertTL_GetBegin_BNTL_GetBegin_DtTL_GetBeginDateTL_GetBeginTimeTL_GetBeginTime_sTL_GetBeginValTL_GetColorTL_GetEnd_BNTL_GetEnd_DtTL_GetEndDateTL_GetEndTimeTL_GetEndTime_sTL_GetEndValTL_GetExtLeftTL_GetExtRightTL_GetFirstTL_GetLockTL_GetNextTL_GetSizeTL_GetStyleTL_GetValueTL_GetValue_BNTL_GetValue_DtTL_GetValue_sTL_LockTL_NewTL_New_BNTL_New_DtTL_New_sTL_New_selfTL_New_Self_BNTL_New_Self_DtTL_New_Self_s

26

Page 27: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetAlertTL_SetBeginTL_SetBegin_BNTL_SetBegin_DTTL_SetBegin_sTL_SetColorTL_SetEndTL_SetEnd_BNTL_SetEnd_DtTL_SetEnd_sTL_SetExtLeftTL_SetExtRightTL_SetSizeTL_SetStyleToTodayTool_DashedTool_Dashed2Tool_Dashed3Tool_DottedTool_SolidTotalTotalBarsEvenTradesTotalBarsLosTradesTotalBarsWinTradesTotalTradesTradeDateTradeTimeTradeVolumeTrueTrueFalseTrueFalseArrayTrueFalseArrayRefTrueFalseRefTrueFalseSeries

27

Page 28: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseSimple

TRY_TuesdayUnderUnsignedUpperStrUpTicksUSDVVarVariableVariablesVarsVarSizeVarStartAddrVoidVolumeWasWednesdayWhileWhiteWORDYearYearFromDateTimeYellowYesterdayZAR

28

Page 29: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetAccount

Returnstheaccountnumberfortheaccountataspecificlocationinthelistofaccounts.

IfthevaluereturnedbyGetNumAccountsisanon-zero,then:

for1<=AccountLoc<=GetNumAccounts,thefunctionreturnstheaccountnumber.

Forothersequencenumbersanemptystring("")isreturned.

Usage

GetAccount(AccountLoc)

Where:AccountLoc-thesequencenumberoftheaccountinthelistofaccounts.

Notes

ThisfunctioncanbeusedalongwithGetNumAccounts,toenumerateavailableaccountsreturnedbybroker.

Example

Thebrokerreturnedthefollowinglistofaccounts:"DU12345","DU23456","DU34567","DU45678".

GetAccount(3)willreturn"DU34567".

GetAccount(5)willreturn"".

29

Page 30: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetAccountID

Returnstheaccountnumberwhichisusedforautotradingonthechart,wherethestrategyisapplied.

Usage

GetAccountID()

Example

GetAccountID()willreturn"DU34567"iftheaccountnumberwhichisusedforautotradingonthechart,wherethestrategyisapplied,isDU12345.

30

Page 31: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetNumAccounts

Returnsthenumberofaccountsinthelistofaccountsobtainedfrombroker.

Ifthelistisempty,an"N/A"value,i.e.0,isreturned.

Usage

GetNumAccounts

Example

Thebrokerreturnedthefollowinglistofaccounts:"DU12345","DU23456","DU34567","DU45678".GetNumAccountswillreturnavalueof4.

31

Page 32: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetNumPositions

ReturnsthenumberofpositionsinMultiChartsOrderandPositionTracker(nottheactualamountatthebroker).

Usage

GetNumPositions(Account)

Where:Account-accountnumberatbroker.

Example

GetNumPositions("DU12345")willreturnavalueof3ifthetotalnumberofopenpositionsinMultiChartsOrderandPositionTrackeris3.

32

Page 33: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPositionAveragePrice

Returnsaveragepriceoftheposition.

Usage

GetPositionAveragePrice(Symbol,Account)

Where:Symbol-thenameoftheinstrument.Account-accountnumberatbroker.

Example

Willreturnavalueof1.3456iftheaverageentrypricefortheposition,definedbyspecifiedaccount/symbolpairis1.3456.

33

Page 34: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPositionOpenPL

ReturnsOpenPLvaluein:

SymbolcurrencyforAvanza(calculatedonMultiChartsside)AccountcurrencyforAvaTrade(calculatedonthebroker'sside)SymbolcurrencyforCQG(calculatedonthebroker'sside)SymbolcurrencyforDukascopy(calculatedonMultiChartsside)AccountcurrencyforFXCM(calculatedonthebroker'sside)SymbolcurrencyforInteractiveBrokers(calculatedonMultiChartsside)SymbolcurrencyforLMAX(calculatedonthebroker'sside)SymbolcurrencyforMBTrading(calculatedonMultiChartsside)SymbolcurrencyforOpenECry(calculatedonthebroker'sside)SymbolcurrencyforPatsystems(calculatedonthebroker'sside)SymbolcurrencyforTradingTechnologies(calculatedonMultiChartsside)SymbolcurrencyforWeBank(calculatedonMultiChartsside)SymbolcurrencyforRithmic(calculatedonthebroker'sside)

Usage

GetPositionOpenPL(Symbol,Account)

Where:Symbol-thenameoftheinstrument.Account-accountnumberatbroker.

Example

Willreturn15ifthecurrentvaluein"OpenPL"columnin"OrderandPositionTracker"windowfortheaccountis15unitsoftheselectedcurrency.

34

Page 35: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPositionQuantity

Returnsthesizeoftheposition,definedbyspecifiedaccount/symbolpair.

Usage

GetPositionQuantity(Symbol,Account)

Where:Symbol-thenameoftheinstrument.Account-accountnumberatbroker.

Example

GetPositionQuantity("ESZ1","DU12345")willreturnavalueof1000ifthesizeoftheposition,definedbyspecifiedaccount/symbolpairpositionis¤1000.

35

Page 36: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPositionSymbol

Returnsthesymbolassociatedwiththepositionataspecificlocation(PositionLoc)inthelistofpositionsforthespecifiedaccount.

Usage

GetPositionSymbol(Account,PositionLoc)

Where:Account-accountnumberatbroker.1<=PositionLoc<=GetNumPositions-thesequencenumberofthepositioninthepositionlistforthespecifiedaccount.

Example

GetPositionSymbol("DU12345",3)willreturn"ESZ1"ifthepositionwiththesequencenumber3inthepositionlistforaccountDU12345isopenedonESZ1.

36

Page 37: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPositionTotalCost

Calculatedwiththefollowingformula:

PTC(PositionTotalCost)=AEP(AverageEntryPrice)xTMP(TotalMarketPosition).

Usage

GetPositionTotalCost(Symbol,Account)

Where:Symbol-thenameoftheinstrument.Account-accountnumberatbroker.

Example

GetPositionTotalCost("ESZ1","DU12345")willreturntotalpositioncostforESZ1onaccountDU1234.

37

Page 38: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetRTAccountEquity

ReturnsregularAccountEquityatbroker.

Usage

GetRTAccountEquity(Account)

Where:Account-accountnameatbroker.

Example

GetRTAccountEquity("DU12345")willreturnavalueof100000iftheAccountEquityatbrokerforDU12345accountis¤100000.

38

Page 39: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetRTAccountNetWorth

ReturnsAccountNetLiquidationvalueatbroker.

Usage

GetRTAccountNetWorth(Account)

Where:Account-accountnameatbroker.

Example

GetRTAccountNetWorth("DU12345")willreturnavalueof100000iftheAccountNetLiquidityatbrokerforDU12345accountis100000inbasecurrency.

39

Page 40: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetRTUnrealizedPL

ReturnstheUnrealized/OpenP&L;forthespecifiedaccount.

Usage

GetRTUnrealizedPL(Account)

Where:Account-accountnumberatbroker.

Example

Willreturnavalueof5000ifUnrealized(Open)P&L;fortheaccountatbrokeris¤5000.

40

Page 41: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InitialCapital

Returnsanumericalvalue,indicatingtheamountofinitialcapitalsetinthestrategyproperties.

Usage

InitialCapital

Example

InitialCapitalwillreturn10000ifInitialCapitalamountwassetto10000intheStrategyProperties.

41

Page 42: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AlertTriggersanalertwindowwherethenecessarytextcanbecreated.Thetextcanbedynamic,staticorabsent.

Usage

Alert

Notes

Ifthetextisn'tsetinthealertthenSource,Symbol,Resolution,Priceisdisplayed

Alertsareshownonthelastbaronly

Detailedinformationofalerts'settingsisavailableinFormattingStudies>Alerts

Example

Thisstatementwillcallanalertwithouttextmessage:

Alert;

Thisstatementcreatesadynamicalerttextanddisplaysthenumberoftheweekday:

Alert(Text("Dayofweekis",DayOfWeek(Date)));

Thisstatementwillshowstatictext:

IfClose>Close[1]ThenAlert(Text("Priceturningup"))

42

Page 43: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AlertEnabledReturnsTrueifthealertshavebeenturnedoninFormatStudy>Alerts.Thisinformationcanmakescriptexecutionmoreefficientbydiscardingredundantcalculations.Thisfunctioncanalsobeusedtonotifytheuserthathewillnotseethealertsuntiltherelevantoptionisturnedon.

Usage

AlertEnabled

Notes

Alertsareonlygeneratedforthelastbar

ThereisadifferencebetweenAlertEnabledandCheckAlert:AlertEnabledreturnsTrue/FalseforallthebarsonthechartwhileCheckAlertdoessoforthelastbaronly

AlertEnabledwillreturnTrueifalertshavebeenenabled

Example

Theexamplebelowshowshowausercanbenotifiedthathehasforgottentoturnonthealerts:

Variable:ID(-1);

IfAlertEnabled=FalseAndLastBarOnChart_S=TrueThen

ID=Text_New_S(Date,Time_S,Low,"Alertsaredisabled.SeeFormatStudy>Properties>Alerts");

43

Page 44: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CancelAlertTheexpressiondeactivatesalerts.Thisisnecessaryifascriptcontainsmultiplealertstatementsandtheyneedtobeturnedoffundercertainconditions.

Usage

CancelAlert

Notes

Alertsareonlygeneratedforthelastbar

Example

Theexampleshowshowallalertscanbeturnedoffdependingontime.Thealertswillnotbedisplayedafter10:00pm.

IfClose>Close[1]ThenAlert("Priceisgoingup");IfVolume>Volume[1]ThenAlert("Volumeisincreasing");IfVolatility(5)>Volatility(5)[1]ThenAlert("Volatilityisrising");IfOpenInt>OpenInt[1]ThenAlert("Openinterestisgrowing");IfTime>=2200ThenCancelAlert;

44

Page 45: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CheckAlertReturnsTrueifthealertshavebeenturnedoninFormattingStudies>Alerts.

True/Falseisreturnedonthelastbaronly.

ForthebarsotherthanthelastFalseisalwaysreturned.

Usage

CheckAlert

Notes

ThereisadifferencebetweenAlertEnabledandCheckAlert.AlertEnabledchecksthestatusonallthebarswhileCheckAlertdoessoforthelastbaronly.Alertsareonlygeneratedforthelastbar.

Example

TheexamplebelowshowshowCheckAlertcanhelpeliminateredundantcalculationsonhistoricbarsaswellasincaseswhenalertsarenotturnedon:

IfCheckAlertThenBeginIfVolume>=2*Average(Volume,10)ThenAlert("Volumeisgoingup");End;

45

Page 46: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_Anchor_to_Bars

Anchorsthecorrespondingarrowdrawingtothevisiblebarindex;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

Arw_Anchor_to_Bars(ArrowID,LogicalExpression)

Where:ArrowIDisanumericalexpressionspecifyingthearrowdrawingIDnumberLogicalExpressionisalogicalvalue;True=addoptionandFalse=removeoption

Notes

ArrowIDnumberisreturnedbyArw_Newwhenthearrowdrawingiscreated.

Example

AnchorthearrowdrawingwithanIDnumberof5tothevisiblebarindex:

Value1=Arw_Anchor_to_Bars(5,true);

46

Page 47: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_Delete

RemovesanarrowobjectwiththespecifiedIDnumberfromachart;returnsavalueof0iftheobjectwassuccessfullyremoved,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_Delete(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

RemovethearrowobjectwithanIDnumberof3:

Value1=Arw_Delete(3);

47

Page 48: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetActive

ReturnsanumericalvalueindicatingtheobjectIDnumberofthecurrentlyselectedarrowobject;returnsavalueof-1ifnoarrowobjectsarecurrentlyselected.

Usage

Arw_GetActive

Notes

Anobject-specificIDnumberisassignedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingtheobjectIDnumberofthecurrentlyselectedarrowobject,toValue1variable:

Value1=Arw_GetActive;

48

Page 49: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetBarNumber

ReturnsanumericalvaluerepresentingthebarnumberofthearrowobjectwithaspecifiedID;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetBarNumber(ref)

Parameters:

ref-IDofthearrowobject

Example

GetthenumberofthebarwherethearrowobjectwithID=1isplaced:

Arw_GetBarNumber(1);

49

Page 50: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothecolorofthearrowcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetColor(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignanRGBcolornumber,correspondingtothecolorofthearrowcontainedinanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetColor(3);

Assignalegacycolorvalue,correspondingtothecolorofthearrowcontainedinanarrowobjectwiththeIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=Arw_GetColor(3);

50

Page 51: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetDate

Returnsanumericalvalue,indicatingthedateofthebaratwhichanarrowobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

Arw_GetDate(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthedateofthebaratwhichanarrowobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Arw_GetDate(3);

51

Page 52: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetDirection

ReturnsalogicalvalueindicatingthedirectionofthearrowcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueofTrueforDownarrow,andavalueofFalseforUparroworifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetDirection(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignatrue/falsevalue,indicatingthedirectionofthearrowcontainedinanarrowobjectwiththeIDnumberof3,toDownArrowvariable:

Variable:DownArrow(False);DownArrow=Arw_GetDirection(3);

52

Page 53: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetFirst

Returnsanumericalvalue,indicatingtheobjectIDnumberoftheoldest(thefirsttobeaddedtothecurrentchart)arrowobjectofthespecifiedorigin;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetFirst(Origin)

Parameters

Origin-anumericalexpressionspecifyingtheoriginofthearrowobject:

1-addedbythecurrentstudy2-addedbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-addedbyanystudy,ordrawnmanuallybytheuser4-addedbythecurrentstudy,ordrawnmanuallybytheuser5-addedbyastudyotherthenthecurrentstudy6-addedbyanystudy7-addedmanuallybytheuser

Notes

Iftheoldest(thefirstadded)arrowobjectisdeleted,thenextoldest(thesecondadded)arrowobjectbecomestheoldest(thefirstadded)arrowobject.

Example

Assignavalue,indicatingtheobjectIDnumberoftheoldestarrowobjectaddedtothechartbythecurrentstudy,toValue1variable:

Value1=Arw_GetFirst(1);

53

Page 54: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetLock

Lockedarrowdrawingscannotbemovedmanually.KeywordreturnsavalueofTrueforlockeddrawings,andavalueofFalseforunlocked.

Usage

Arw_GetLock(ArrowID)

Where:ArrowID-anumericalexpressionspecifyingthearrowdrawingIDnumber

Notes

AnarrowIDnumberisreturnedbyArw_Newwhenthearrowdrawingiscreated.

Example

AssignLockpropertyofthearrowdrawingwithanIDnumberof3toCondition1variable:

Condition1=Arw_GetLock(3);

54

Page 55: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetNext

ReturnstheIDnumberofthefirstexistingarrowobjectaddedsubsequenttoanarrowobjectwiththespecifiedIDnumber,withbothobjectsofaspecifiedorigin;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetNext(ObjectID,Origin)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Origin-anumericalexpressionspecifyingtheoriginofthearrowobjects:

1-addedbythecurrentstudy2-addedbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-addedbyanystudy,ordrawnmanuallybytheuser4-addedbythecurrentstudy,ordrawnmanuallybytheuser5-addedbyastudyotherthenthecurrentstudy6-addedbyanystudy7-addedmanuallybytheuser

Example

AssignavaluetoValue1variable,indicatingtheIDnumberofthefirstexistingarrowobjectaddedsubsequenttoanarrowobjectwiththeIDnumberof3,withbothobjectsaddedbythecurrentstudy:

Value1=Arw_GetNext(3,1);

55

Page 56: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetSize

ReturnsanumericalvalueindicatingthesizeofthearrowcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetSize(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthesizeofthearrowinanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetSize(3);

56

Page 57: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetStyle

Returnsanumericalvalue,indicatingthestyleofthearrowinanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetStyle(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthestyleofthearrowinanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetStyle(3);

57

Page 58: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetText

ReturnsastringexpressioncorrespondingtothetextcontainedinanarrowobjectwiththespecifiedIDnumber.

Usage

Arw_GetText(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Arw_GetText(3)willreturnastringexpressioncorrespondingtothetextcontainedinanarrowobjectwiththeIDnumberof3

58

Page 59: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTextAttribute

ReturnsalogicalvalueindicatingthesettingforanattributeofthetextinanarrowobjectwiththespecifiedIDnumber;returnsavalueofTrueiftheattributeissettoon,andavalueofFalseiftheattributeissettoofforifthespecifiedobjectIDnumberisinvalid.

Thesettingsofthefollowingattributescanbereturned:border,bold,italic,strike-out,andunderline.

Usage

Arw_GetTextAttribute(ObjectID,Attribute)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Attribute-anumericalexpressionspecifyingtheattribute:

0-border1-bold2-italic3-strike-out4-underline

Notes

Anobject-specificIDnumberisassignedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignatrue/falsevalue,indicatingthesettingof"bold"attributeforthearrowobjectwithanIDnumberof3,toArwTxtBoldvariable:

59

Page 60: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Variable:ArwTxtBold(False);ArwTxtBold=Arw_GetTextAttribute(3,1);

60

Page 61: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTextBGColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothetextbackgroundcolorofanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetTextBGColor(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignanRGBcolornumber,correspondingtothetextbackgroundcolorofanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetTextBGColor(3);

Assignalegacycolorvalue,correspondingtothetextbackgroundcolorofanarrowobjectwiththeIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=Arw_GetTextBGColor(3);

61

Page 62: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTextColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothecolorofthetextcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetTextColor(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignanRGBcolornumber,correspondingtothecolorofthetextcontainedinanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetTextColor(3);

Assignalegacycolorvalue,correspondingtothecolorofthetextcontainedinanarrowobjectwiththeIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=Arw_GetTextColor(3);

62

Page 63: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTextFontName

ReturnsastringexpressioncorrespondingtothenameofthetextfontassignedtoanarrowobjectwiththespecifiedIDnumber.

Usage

Arw_GetTextFontName(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Arw_GetTextFontName(3)willreturnastringexpressioncorrespondingtothenameofthetextfontassignedtoanarrowobjectwiththeIDnumberof3

63

Page 64: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTextSize

ReturnsanumericalvalueindicatingthefontsizeassignedtothetextofanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetTextSize(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthefontsizeofthetextinanarrowobjectwiththeIDnumberof3,toValue1variable:

Value1=Arw_GetTextSize(3);

64

Page 65: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTime

Returnsanumericalvalue,indicatingthetimeofthebaratwhichanarrowobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

Arw_GetTime(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichanarrowobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Arw_GetTime(3);

65

Page 66: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTime_DT

Returnsadouble-precisiondecimalDateTimevalueindicatingthetimeofthebaratwhichanarrowobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

ThetimeisindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

Arw_GetTime_DT(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_New_dtwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichanarrowobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Arw_GetTime_DT(3);

66

Page 67: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetTime_s

Returnsanumericalvalueindicatingthetimeofthebar,includingseconds,atwhichanarrowobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

Arw_GetTime_s(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_New_swhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichanarrowobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Arw_GetTime_s(3);

67

Page 68: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_GetVal

Returnsthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),atwhichanarrowobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_GetVal(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignavalue,indicatingthepricevalueatwhichanarowobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Arw_GetVal(3);

68

Page 69: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_Get_Anchor_to_Bars

Returnsthevalueof"anchortobar"optionofthearrowdrawingwithaspecifiedID.

Usage

Arw_Get_Anchor_to_Bars(ArrowID)

Where:ArrowIDisanumericalexpressionspecifyingthearrowdrawingIDnumber

Notes

AnarrowIDnumberisreturnedbyArw_Newwhenthearrowdrawingiscreated.

Example

Assign"anchortobars"optionofthearrowdrawingwithanIDnumberof3totheCondition1variable:

Condition1=Arw_Get_Anchor_to_Bars(3);

69

Page 70: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_Lock

Lockscorrespondingarrowdrawingsoitcannotbemovedmanually;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

Arw_Lock(ArrowID,LogicalExpression)

Where:ArrowID-anumericalexpressionspecifyingthearrowdrawingIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

AnarrowIDnumberisreturnedbyArw_Newwhenthearrowdrawingiscreated.

Example

LockthearrowdrawingwithanIDnumberof3:

Value1=Arw_Lock(3,True);

UnlockthearrowdrawingwithanIDnumberof5:

Value1=Arw_Lock(5,False);

70

Page 71: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New(BarDate,BarTime,PriceValue,Direction)

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,onthechartthatthestudyisbasedon,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New(Date,Time,High,False);

71

Page 72: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_BN

Displaysanobjectconsistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalueonthechartthatthestudyisbasedon;returnsanobject-specificIDnumberrequiredtomodifytheobject.

Usage

Arw_New_BN(BarNumber,PriceValue,Direction)

Parameters

BarNumber-anumericalexpressionspecifyingthebarnumberatwhichtheobjectistobeplaced.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectshouldbeplaced.

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Onthechartthatthestudyisbasedon,placeanuparrowatthetopofacurrentbariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_BN(currentbar,High,False);

72

Page 73: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_DT

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New_DT(Bar_DateTime,PriceValue,Direction)

Parameters

Bar_DateTime-anumericalexpressionspecifyingthedateandtimeofthebaratwhichtheobjectistobeplaced.ThedateandtimeareindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,onthechartthatthestudyisbasedon,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_DT(DateTime,High,False);

73

Page 74: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_s

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New_s(BarDate,BarTime_s,PriceValue,Direction)

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,onthechartthatthestudyisbasedon,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_s(Date,Time_s,High,False);

74

Page 75: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_self

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New_self(BarDate,BarTime,PriceValue,Direction)

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,ontheSubChartcontainingthestudy,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_self(Date,Time,High,False);

75

Page 76: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ARW_New_Self_BNThesameasArw_New_BN.Difference:DisplaysaarrowontheSubChartcontainingthestudy.

76

Page 77: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_Self_DT

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New_Self_DT(Bar_DateTime,PriceValue,Direction)

Parameters

Bar_DateTime-anumericalexpressionspecifyingthedateandtimeofthebaratwhichtheobjectistobeplaced.ThedateandtimeareindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,ontheSubChartcontainingthestudy,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_Self_DT(DateTime,High,False);

77

Page 78: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_New_self_s

Displaysanobject,consistingofanuporadownarrowlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Arw_New_self_s(BarDate,BarTime_s,PriceValue,Direction)

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Direction-alogicalexpressionspecifyingthedirectionofthearrow;True=DownandFalse=Up

Example

Place,ontheSubChartcontainingthestudy,anuparrowatthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Arw_New_self_s(Date,Time_s,High,False);

78

Page 79: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetBarNumber

AssignsthespecifiedbarnumbertothearrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthebarnumberwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetBarNumber(ref,Barnumber)

Parameters:

ref-IDofthearrowobjectBarnumber-thenewbarnumberthatistobeassignedtothespecifiedobject.

Example

Assignthenewbarnumbervalueof100tothearrowobjectwithID=1:

Arw_SetBarNumber(1,100);

79

Page 80: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetColor

AssignsthespecifiedcolortothearrowcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetColor(ObjectID,ArrowColor)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

ArrowColor-anexpressionspecifyingthecolorofthearrow

ThecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignthecolorbluetothearrowcontainedinanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothearrowcontainedinanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetColor(3,2138336);

80

Page 81: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Assignthelegacycolor4(Green)tothearrowcontainedinanarrowobjectwiththeIDnumberof3:

[LegacyColorValue=True];Value1=Arw_SetColor(3,4);

81

Page 82: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetLocation

ModifiesthelocationofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetLocation(ObjectID,BarDate,BarTime,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

MovethearrowobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Arw_SetLocation(3,Date,Time,High);

82

Page 83: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

83

Page 84: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetLocation_BN

ModifieslocationofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0iflocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetLocation_BN(ObjectID,BarNumber,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber.

BarNumber-anumericalexpressionspecifyingthebarnumberatwhichtheobjectistobeplaced.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectshouldbeplaced.

Notes

Anobject-specificIDnumberisreturnedbyArw_New_Dtwhenthearrowobjectiscreated.

Example

MovethearrowobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Arw_SetLocation_BN(3,currentbar,High);

84

Page 85: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetLocation_DT

ModifiesthelocationofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetLocation_DT(ObjectID,Bar_DateTime,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber.

Bar_DateTime-anumericalexpressionspecifyingthedateandtimeofthebaratwhichtheobjectistobeplaced.ThedateandtimeareindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Notes

Anobject-specificIDnumberisreturnedbyArw_New_Dtwhenthearrowobjectiscreated.

Example

MovethearrowobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Arw_SetLocation_DT(3,DateTime,High);

85

Page 86: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

86

Page 87: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetLocation_s

ModifiesthelocationofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetLocation_s(ObjectID,BarDate,BarTime_s,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Notes

Anobject-specificIDnumberisreturnedbyArw_New_swhenthearrowobjectiscreated.

Example

MovethearrowobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Arw_SetLocation_s(3,Date,Time_s,High);

87

Page 88: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

88

Page 89: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetSize

AssignsthespecifiedsizetothearrowcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthesizewassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetSize(ObjectID,ArrowSize)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberArrowSize-anumericalexpressionspecifyingthearrowsize

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignanarrowsizeof10tothearrowobjectwithanIDnumberof3:

Value1=Arw_SetSize(3,10);

89

Page 90: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetStyle

AssignsthespecifiedstyletothearrowofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthearrowstylewassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetStyle(ObjectID,ArrowStyle)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberArrowStyle-anumericalexpressionspecifyingthearrowstyle;arrowstylesrangefrom0to13

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignthearrowstyleof5toanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetStyle(3,5);

90

Page 91: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetText

Addstextto,orreplacestheexistingtextcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetText(ObjectID,"Text")

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberText-thestringexpressiontobedisplayedinthearrowobject

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Addtext"MyArrow"tothearrowobjectwithanIDnumberof3:

Value1=Arw_SetText(3,"MyArrow");

ReplacetextcontainedinthearrowobjectwithanIDnumberof3withthestringexpression"NewText":

Value1=Arw_SetText(3,"NewText");

91

Page 92: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetTextAttribute

SetsanattributeofthetextinanarrowobjectwiththespecifiedIDnumber;returnsavalueof0iftheattributewassuccessfullyset,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thefollowingtextattributescanbeset:border,bold,italic,strike-out,andunderline.

Usage

Arw_SetTextAttribute(ObjectID,Attribute,LogicalExpression)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Attribute-anumericalexpressionspecifyingtheattribute:

0-border1-bold2-italic3-strike-out4-underline

LogicalExpression-alogicalvalue;True=onandFalse=off

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Settheattribute"bold"toonforthetextinanarrowobjectwiththeIDnumberof3:

92

Page 93: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=Arw_SetTextAttribute(3,1,True);

93

Page 94: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetTextBGColor

AssignsthespecifiedbackgroundcolortothetextofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetTextBGColor(ObjectID,TextBGColor)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

TextBGColor-anexpressionspecifyingthetextbackgroundcolor

ThecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignthecolorbluetothetextbackgroundofanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextBGColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothetextbackgroundofanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextBGColor(3,2138336);

94

Page 95: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Assignthelegacycolor4(Green)tothetextbackgroundofanarrowobjectwiththeIDnumberof3:

[LegacyColorValue=True];Value1=Arw_SetTextBGColor(3,4);

95

Page 96: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetTextColor

AssignsthespecifiedcolortothetextcontainedinanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetTextColor(ObjectID,TextColor)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

TextColor-anexpressionspecifyingthecolorofthetext

ThecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignthecolorbluetothetextcontainedinanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothetextcontainedinanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextColor(3,2138336);

96

Page 97: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Assignthelegacycolor4(Green)tothetextcontainedinanarrowobjectwiththeIDnumberof3:

[LegacyColorValue=True];Value1=Arw_SetTextColor(3,4);

97

Page 98: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetTextFontName

AssignsthespecifiedfonttothetextofanarrowobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

AnyfontintheFontsfoldercanbeused;thefolderisaccessiblefromtheControlPanelinWindowsXPoperatingsystem.

Usage

Arw_SetTextFontName(ObjectID,"FontName")

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberFontName-astringexpressionspecifyingthefontname

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

AssignfontVerdanatothetextofanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextFontName(3,"Verdana");

98

Page 99: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Arw_SetTextSize

AssignsthespecifiedfontsizetothetextofanarrowobjectwiththespecifiedIDnumber;returnsavalueof0ifthefontsizewassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Arw_SetTextSize(ObjectID,FontSize)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberFontSize-anumericalexpressionspecifyingthefontsize

Notes

Anobject-specificIDnumberisreturnedbyArw_Newwhenthearrowobjectiscreated.

Example

Assignthefontsizeof16tothetextofanarrowobjectwiththeIDnumberof3:

Value1=Arw_SetTextSize(3,16);

99

Page 100: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_Arw_GetActiveReturnsanumericalvalueindicatingthearrowIDnumberofthecurrentlyselectedarrow;returnsavalueof-1ifnoarrowsarecurrentlyselected.

Usage

MC_Arw_GetActive

Example

Assignavalue,indicatingthearrowIDnumberofthecurrentlyselectedarrow,toValue1variable:Value1=MC_Arw_GetActive;

100

Page 101: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AllowSendOrdersAlways

AttributesettoTrueallowsordergenerationevenwhenbarstatusisnotdefined(-1willbereturned).

Usage

[AllowSendOrdersAlways=LogicalValue]

Where:LogicalValue-atrue/falsevalue;True=Enable;False=Disable

IftheattributeissettoFalse,ornotpresentinthestudy'scode,itdoesn'tallowordergenerationwhenbarstatusisnotdefined.

IftheattributeissettoTrue,thenallowsgenerationevenwhenbarstatus=-1.

Example

EnableAllowSendOrdersAlwaysvalue:

[AllowSendOrdersAlways=True];

101

Page 102: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntraBarOrderGeneration

Togglesintra-barordergenerationflagonoroff.

Usage

[IntrabarOrderGeneration=LogicalValue]

Where:LogicalValue-atrue/falsevalue;True=Enable;False=Disable

Iftheattributeisnotpresentinthestudy'scode,intra-barordergenerationcanbesetbytheuserintheCalculationstaboftheFormatSignalwindow.

IfsettoTrue,"Enableintra-barordergenerationandcalculation"checkboxwillbecheckedandgrayedout,andtheradiobuttonswillbeavailable.

IfsettoFalse,"Enableintra-barordergenerationandcalculation"checkboxwillbeuncheckedandgrayedout,andtheradiobuttonsdisabled.

Notes

Attributesareappliedatthetimeofcompilationandcannotbechangedatrun-time.

Example

Enableintra-barordergeneration:

[IntrabarOrderGeneration=True];

102

Page 103: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LegacyColorValue

Specifiesthecolordesignationschemetobeusedforinterpretationofnumericalcolorvalues.

Usage

[LegacyColorValue=LogicalValue]

Where:LogicalValue-atrue/falsevalue;True=Enable;False=Disable

IftheattributeissettoFalse,ornotpresentinthestudy'scode,theRGB(new)16Mcolorschemewillbeused.

IfLegacyColorValuetheattributeissettoTrue,thelegacy(old)16-bit,16-colorschemewillbeused.

Notes

Whenacolornameisconvertedtoanumericalcolorvalue,thespecifiedschemewillbefollowed.

Toensurecompatibility,theattribute[LegacyColorValue=True]isinsertedautomaticallywhenolderversions,priortov8.1,ofEasyLanguagestudiesareimported.

Example

Enablelegacycolorvalueinterpretation:

[LegacyColorValue=True];

CreateaGreencolorplotusingthelegacycolorscheme:

[LegacyColorValue=True];

103

Page 104: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plot1(Open);

SetPlotColor(1,4);

CreateaGreencolorplotusingtheRGBcolorscheme:

[LegacyColorValue=False];

Plot1(Open);

SetPlotColor(1,65280);

Assignavalue,representingthecolorGreenunderthelegacycolorscheme,toValue1(Value1willbeassignedavalueof4):

[LegacyColorValue=True];

Value1=Green;

Assignavalue,representingthecolorGreenundertheRGBcolorscheme,toValue1(Value1willbeassignedavalueof65280):

[LegacyColorValue=False];

Value1=Green;

104

Page 105: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ProcessMouseEvents

Declaresthatthestudyprocessesmouseevents.

Usage

[ProcessMouseEvents=LogicalValue]

Where:LogicalValue-atrue/falsevalue;True=Enable;False=Disable

Notes

Ifthisattributeisnotpresentinthestudy'scode,theindicatorbasedinthemouseeventswillnotbecalculated.Canbeusedonlyinsignalsandindicators

Example

[ProcessMouseEvents=True];

105

Page 106: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SameExitFromOneEntryOnce

AttributedefinespossibilityofpositionExitusingoneandthesameorder.Ifitisnotspecifiedinthescript,thensettoTruebydefault.

Usage

[SameExitFromOneEntryOnce=LogicalValue]

Where:LogicalValue-atrue/falsevalue;True=Enable;False=Disable

IftheattributeissettoTrue,ornotpresentinthestudy'scode,thenexitfromthespecifiedpositionusingoneandthesameorderisnotpossible.

IftheattributeissettoFalse,thenspecifiedpositioncanbeclosedusingoneandthesameorderunlimitedly.

Example

DisableSameExitFromOneEntryOncevalueinterpretation:

[SameExitFromOneEntryOnce=False];

buy5contractsnextbarmarket;

sell1contractsnextbarmarket;

WhenbacktestingthegivenstrategyoneandthesameExitorder(generatedbysellnextbarmarketcommand)isappliedforpartialpositionclose5times.

Commentingoutthefirstscriptlinedefaultbehaviorwillbeobtained.Exitorderwilltriggeronlyonce.

106

Page 107: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Black

Constant,usedtodesignatethecolorBlack.

Usage

Black

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorBlack:

Plot1(Open);SetPlotColor(1,Black);

107

Page 108: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Blue

Constant,usedtodesignatethecolorBlue.

Usage

Blue

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorBlue:

Plot1(Open);SetPlotColor(1,Blue);

108

Page 109: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Cyan

Constant,usedtodesignatethecolorCyan.

Usage

Cyan

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorCyan:

Plot1(Open);SetPlotColor(1,Cyan);

109

Page 110: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkBlue

Constant,usedtodesignatethecolorDarkBlue.

Usage

DarkBlue

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkBlue:

Plot1(Open);SetPlotColor(1,DarkBlue);

110

Page 111: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkBrown

Constant,usedtodesignatethecolorDarkBrown.

Usage

DarkBrown

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkBrown:

Plot1(Open);SetPlotColor(1,DarkBrown);

111

Page 112: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkCyan

Constant,usedtodesignatethecolorDarkCyan.

Usage

DarkCyan

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkCyan:

Plot1(Open);SetPlotColor(1,DarkCyan);

112

Page 113: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkGray

Constant,usedtodesignatethecolorDarkGray.

Usage

DarkGray

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkGray:

Plot1(Open);SetPlotColor(1,DarkGray);

113

Page 114: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkGreen

Constant,usedtodesignatethecolorDarkGreen.

Usage

DarkGreen

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkGreen:

Plot1(Open);SetPlotColor(1,DarkGreen);

114

Page 115: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkMagenta

Constant,usedtodesignatethecolorDarkMagenta.

Usage

DarkMagenta

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkMagenta:

Plot1(Open);SetPlotColor(1,DarkMagenta);

115

Page 116: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkRed

Constant,usedtodesignatethecolorDarkRed.

Usage

DarkRed

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkRed:

Plot1(Open);SetPlotColor(1,DarkRed);

116

Page 117: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DarkYellow

Constant,usedtodesignatethecolorDarkYellow.

Usage

DarkYellow

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorDarkYellow:

Plot1(Open);SetPlotColor(1,DarkYellow);

117

Page 118: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetBValueReturnstheBluecolorcomponentvalueofanRGBcolornumber;thevaluerangesfrom0to255.

Usage

GetBValue(BigRGBValue)

Where:BigRGBValue-anRGBcolornumberfrom0to16777215

Example

Assignavalue,representingtheBluecolorcomponentoftheRGBcolornumber2138336(Orange),toValue1(Value1willbeassignedavalueof32):

Value1=GetBValue(2138336);

118

Page 119: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetGValueReturnstheGreencolorcomponentvalueofanRGBcolornumber;thevaluerangesfrom0to255.

Usage

GetGValue(BigRGBValue)

Where:BigRGBValue-anRGBcolornumberfrom0to16777215

Example

Assignavalue,representingtheGreencolorcomponentoftheRGBcolornumber2138336(Orange),toValue1(Value1willbeassignedavalueof160):

Value1=GetGValue(2138336);

119

Page 120: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetRValueReturnstheRedcolorcomponentvalueofanRGBcolornumber;thevaluerangesfrom0to255.

Usage

GetRValue(BigRGBValue)

Where:BigRGBValue-anRGBcolornumberfrom0to16777215

Example

Assignavalue,representingtheRedcolorcomponentoftheRGBcolornumber2138336(Orange),toValue1(Value1willbeassignedavalueof224):

Value1=GetRValue(2138336);

120

Page 121: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GradientColorReturnsanRGBcolornumber,representingashadeofcolorfromwithinadefinedcolorrange.Thegradientshadeofcolorisdeterminedbythevalueofthespecifiednumericalexpressioninrelationtothedefinedvaluerange.

Forexample,ifthecolorrangeisdefinedasWhitetoBlack,andthevaluerangeisdefinedfrom0to2,GradientColorwillreturnanRGBcolornumberrepresentingWhiteforthevalueof0,Grayforthevalueof1,andBlackforthevalueof2.Whitewillbereturnedforallvalues<0,andBlackforallvalues>2.

Usage

GradientColor(Value,Min,Max,StartColor,EndColor)

Where:ValuethespecifiednumericalexpressionMintheminimumvalueofthevaluerange;ifValue=Min,StartColorisreturnedMaxthemaximumvalueofthevaluerange;ifValue=Max,EndColorisreturnedStartColorthestartingcolorofthecolorrangeEndColortheendingcolorofthecolorrange

Example

PlotanADXindicatorinGradientColor,whereMagentagraduallychangesintoWhitefortheindicatorvaluesfrom5to50:

Variable:ADXValue(0);ADXValue=ADX(14);Plot1(ADXValue,"ADXValue");SetPlotColor(1,GradientColor(ADXValue,5,50,Magenta,White));

121

Page 122: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Green

Constant,usedtodesignatethecolorGreen.

Usage

Green

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorGreen:

Plot1(Open);SetPlotColor(1,Green);

122

Page 123: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LegacyColorToRGBReturnsanRGBcolornumberthatcorrespondstothespecifiedlegacycolorvalue;thenumberrangesfrom0to16777215.

Usage

LegacyColorToRGB(LegacyColorValue)

Where:LegacyColorValue-alegacycolorvaluefrom1to16

Example

Assignavalue,representingthecolor4(Green)underthelegacycolorscheme,toValue1(Value1willbeassignedavalueof65280):

Value1=LegacyColorToRGB(4);

123

Page 124: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LightGray

Constant,usedtodesignatethecolorLightGray.

Usage

LightGray

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorLightGray:

Plot1(Open);SetPlotColor(1,LightGray);

124

Page 125: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Magenta

Constant,usedtodesignatethecolorMagenta.

Usage

Magenta

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorMagenta:

Plot1(Open);SetPlotColor(1,Magenta);

125

Page 126: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Red

Constant,usedtodesignatethecolorRed.

Usage

Red

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorRed:

Plot1(Open);SetPlotColor(1,Red);

126

Page 127: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RGBReturnsanRGBcolornumberthatcorrespondstothespecifiedcombinationofred,green,andbluecomponentcolorvalues;thenumberrangesfrom0to16777215andrepresentsoneof16Mcolors.

Usage

RGB(Red,Green,Blue)

Where:Redanumericalvaluefrom0to255,specifyingtheRedcomponentoftheRGBcolorGreenanumericalvaluefrom0to255,specifyingtheGreencomponentoftheRGBcolorBlueanumericalvaluefrom0to255,specifyingtheBluecomponentoftheRGBcolor

Example

CreateanOrangecolorplotusingtheRGBcolorcombination:

Plot1(Open);SetPlotColor(1,RGB(224,160,32));

127

Page 128: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RGBToLegacyColorReturnsthelegacycolorvaluethatmostcloselymatchesthespecifiedRGBcolornumber;thevaluerangesfrom0to16.

Usage

RGBToLegacyColor(RGBColorValue)

Where:RGBColorValue-anRGBcolornumberfrom0to16777215

Example

Assignavalue,representingthecolor65280(Green)undertheRGBcolorscheme,toValue1(Value1willbeassignedavalueof4):

Value1=RGBToLegacyColor(65280);

128

Page 129: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

White

Constant,usedtodesignatethecolorWhite.

Usage

White

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorWhite:

Plot1(Open);SetPlotColor(1,White);

129

Page 130: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Yellow

Constant,usedtodesignatethecolorYellow.

Usage

Yellow

Notes

Thebase17colorscanbedesignatedbyconstants.

Example

CreateaplotusingthecolorYellow:

Plot1(Open);SetPlotColor(1,Yellow);

130

Page 131: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AboveUsedincombinationwithCrosstospecifythedirectionofthecross.

Abovespecifiesanupward(lessertoagreatervalue)direction.

TheplotofAisdefinedashavingcrossedAbovetheplotofBifthevalueofAisgreaterthanthevalueofBandoneofthefollowingistrue:

a)ThevalueofAwaslessthanthevalueofBonthebarimmediatelyprecedingthecurrentbar

or

b)ThevaluesofAandBwereequalforaconsecutivesequenceofoneormorebarsimmediatelyprecedingthecurrentbarandthevalueofAwaslessthanthevalueofBonthebarimmediatelyprecedingthissequenceofbars.

FormoreinformationseeCross.

Usage

E1CrossAboveE2

or:

Plot1CrossAbovePlot2

Where:E-anumericalexpression

Example

TriggeranalertonthebarwheretheClosepricecrossesabove1350.00:

Plot1(Close);IfPlot1CrossAbove1350.50ThenAlert("Pricehascrossedabove1350.00");

131

Page 132: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AndAlogical(Boolean)operatorthatreturnsTrueonlyifbothofitsoperandsaretrue.Logicaloperatorsareusedinlogical(Boolean)expressionsthatoperatewithtrue/falsevalues.

Usage

E1AndE2

Where:E-true/falseexpressions

Example

2=1And2=2willreturnavalueofFalse

TrueAndTrueAndTruewillreturnavalueofTrue

132

Page 133: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BeginUsedincombinationwithEndtogroupinstructionsforconditionalexecution;aBeginmustalwaysbefollowedbyanEnd.

BeginandEndcanbeusedwithThen,Else,For,andWhileconditionalstatements.

Beginshouldnotbefollowedbyasemicolon(;),codelineswithinaninstructiongroupshouldendwithasemicolon(;),andonlythelastinstanceofEndwithinthesameconditionalexecutionstatementshouldbefollowedbyasemicolon(;).

Usage

CSBeginI1;I2;

I3;

End;

Where:CS-conditionalstatementI-conditionalinstructions

Example

IfUpTrendistruethenbuy,otherwisesellshort:

IfUpTrendThenBeginBuyNextBarMarket;End

ElseBegin

SellShortNextBarMarket;End;

133

Page 134: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BelowUsedincombinationwithCrosstospecifythedirectionofthecross.

Belowspecifiesadownward(greatertoalesservalue)direction.

TheplotofAisdefinedashavingcrossedBelowtheplotofBifthevalueofAislessthanthevalueofBandoneofthefollowingistrue:

a)ThevalueofAwasmorethanthevalueofBonthebarimmediatelyprecedingthecurrentbar,

or

b)ThevaluesofAandBwereequalforaconsecutivesequenceofoneormorebarsimmediatelyprecedingthecurrentbarandthevalueofAwasmorethanthevalueofBonthebarimmediatelyprecedingthissequenceofbars.

FormoreinformationseeCross.

Usage

E1CrossBelowE2

or:

Plot1CrossBelowPlot2

Where:E-anumericalexpression

Example

TriggeranalertonthebarwheretheClosepricecrossesbelow1350.00:

Plot1(Close);IfPlot1CrossBelow1350.50ThenAlert("Pricehascrossedbelow1350.00");

134

Page 135: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BreakBreakstheloopexecution.

Usage

Break;

Example

Forvalue1=0to10BeginIf(close[value1]=open[value1])thenBreak;End;Ifvalue1<=10thenprint("Open=Close",value1:0:0,"barsago.");

135

Page 136: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

casePartofswitch-caseoperator.

Usage

Seeinexample

Example

switchgetplotcolor(1)begincasegreen:print("Indicatoringreenzoneonbar",currentbar);casered:print("Indicatorinredzoneonbar",currentbar);casered:print("Indicatorisneutralonbar",currentbar);end;

136

Page 137: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CrossReturnsavalueofTrueif,onthecurrentbar,theplotofanumericalexpressionAcrossedtheplotofanumericalexpressionBinthespecifieddirection.

Above,Over,Below,orUnderparametersspecifythedirectionofthecross;AboveandOveraretransposableandspecifyanupward(lessertoagreatervalue)direction,andBelowandUnderaretransposableandspecifyadownward(greatertoalesservalue)direction.

TheplotofAisdefinedashavingcrossedAboveorOvertheplotofBifthevalueofAisgreaterthanthevalueofBandoneofthefollowingistrue:

a)ThevalueofAwaslessthanthevalueofBonthebarimmediatelyprecedingthecurrentbar

or

b)ThevaluesofAandBwereequalforaconsecutivesequenceofoneormorebarsimmediatelyprecedingthecurrentbarandthevalueofAwaslessthanthevalueofBonthebarimmediatelyprecedingthissequenceofbars.

TheplotofAisdefinedashavingcrossedBeloworUndertheplotofBifthevalueofAislessthanthevalueofBandoneofthefollowingistrue:

a)ThevalueofAwasmorethanthevalueofBonthebarimmediatelyprecedingthecurrentbar,

or

b)ThevaluesofAandBwereequalforaconsecutivesequenceofoneormorebarsimmediatelyprecedingthecurrentbarandthevalueofAwasmorethanthevalueofBonthebarimmediatelyprecedingthissequenceofbars.

Usage

E1CrossDirectionE2

or:

137

Page 138: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plot1CrossDirectionPlot2

Where:E-anumericalexpressionDirection-arequiredparameter;specifiesthedirectionofthecross

Example

TriggeranalertonthebarwheretheClosepricecrossesabove1350.00:

Plot1(Close);IfPlot1CrossAbove1350.50ThenAlert("Pricehascrossedabove1350.00");

138

Page 139: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CrossesSameasCross

139

Page 140: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DownToUsedincombinationwithFortoformaloopstatementthatwillexecuteasetofinstructionsrepeatedlyuntiltheloopcountreachesthespecifiedfinalvalue.

DownTospecifiesthatthevalueofthecountervariableistobedecreasedbyoneonthecompletionofeachloop.

FormoreinformationseeFor.

Usage

ForCounter=IValueDownToFValueBeginI1;I2;

End;

Where:Counter-anumericalvariableusedstoretheloopcountIValue-anumericalexpressionspecifyingtheinitialcountervalueFValue-anumericalexpressionspecifyingthefinalcountervalue

Example

Addthehighpricesofthelast10barstotheHighPriceSumvariable:

ForBarBackNo=9DownTo0BeginHighPriceSum=HighPriceSum+High[BarBackNo];End;

140

Page 141: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ElseUsedincombinationwithIfandThentoformaconditionalstatementthatexecutesspecificinstructionsifalogicalexpressionisfalse.

TheconditionalexecutionstatementmustcontainbothIfandTheninadditiontoElse.

FormoreinformationseeIf.

Usage

IfEThenI1ElseI2

Where:E-atrue/falseexpressionI-conditionalinstructions

Example

IfUpTrendistruethenbuyandifUpTrendisfalsethensellshort:

IfUpTrendThenBuyNextBarMarketElseSellShortNextBarMarket;

141

Page 142: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EndUsedincombinationwithBegintogroupinstructionsforconditionalexecution;anEndmustalwaysbeprecededbyaBegin.BeginandEndcanbeusedwithThen,Else,For,andWhileconditionalstatements.

OnlythelastinstanceofEndwithinthesameconditionalexecutionstatementshouldbefollowedbyasemicolon(;).

Usage

CSBeginI1;I2;

I3;

End;

Where:CS-conditionalstatementI-conditionalinstructions

Example

IfUpTrendistruethenbuy,otherwisesellshort:

IfUpTrendThenBeginBuyNextBarMarket;End

ElseBegin

SellShortNextBarMarket;End;

142

Page 143: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FalseAlogical(Boolean)value.Logicalvaluesareusedinlogical(Boolean)expressionsandfortrue/falseinputs.

Usage

False

Example

FalseAndTruewillreturnavalueofFalse

2=1willreturnavalueofFalse

DeclareLogicalVarasatrue/falsevariablewiththeinitialvalueoffalse:

Variable:LogicalVar(False);

DeclareOvernightasatrue/falseinputwiththedefaultvalueoffalse:

Input:Overnight(False);

143

Page 144: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ForUsedincombinationwithToorDownTotoformaloopstatementthatwillexecuteasetofinstructionsrepeatedlyuntiltheloopcountreachesthespecifiedfinalvalue.

Theloopstatementspecifiesanumericalvariablethatholdstheloopcount,aswellasinitialandfinalcountervalues.Tospecifiesthatthevalueofthecountervariableistobeincreasedbyoneonthecompletionofeachloop,whileDownTospecifiesthatthevalueofthecountervariableistobedecreasedbyoneonthecompletionofeachloop.

TheuseofBeginandEndstatementsisrequiredtogrouptheinstructionsforexecutionwithintheloop;aBeginmustalwaysbefollowedbyanEnd.

Beginshouldnotbefollowedbyasemicolon(;),codelineswithinaninstructiongroupshouldendwithasemicolon(;),andEndshouldbefollowedbyasemicolon(;).

Usage

ForCounter=IValueToFValueBeginI1;I2;

End;

or:

ForCounter=IValueDownToFValueBeginI1;

I2;

End;

Where:Counter-anumericalvariableusedstoretheloopcountIValue-anumericalexpressionspecifyingtheinitialcountervalueFValue-anumericalexpressionspecifyingthefinalcountervalue

Example

Addthehighpricesofthelast10barstotheHighPriceSumvariable:

ForBarBackNo=0To9Begin

144

Page 145: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HighPriceSum=HighPriceSum+High[BarBackNo];End;

Addthehighpricesofthelast10barstotheHighPriceSumvariable:

ForBarBackNo=9DownTo0BeginHighPriceSum=HighPriceSum+High[BarBackNo];End;

145

Page 146: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IfUsedincombinationwithThentoformaconditionalstatementthatexecutesspecificinstructionsifalogicalexpressionistrue,andwithElsetoformaconditionalstatementthatexecutesspecificinstructionsifalogicalexpressionisfalse.

TheconditionalexecutionstatementmustcontainbothIfandThen;Elseisoptional.

BeginandEndstatementsareusedtogroupinstructionsforconditionalexecution;aBeginmustalwaysbefollowedbyanEnd.

Beginshouldnotbefollowedbyasemicolon(;),codelineswithinaninstructiongroupshouldendwithasemicolon(;),andonlythelastinstanceofEndwithinthesameconditionalexecutionstatementshouldbefollowedbyasemicolon(;).

Usage

IfEThenI1ElseI2

or:

IfEThenBeginI1;I2;

End

ElseBegin

I3;

I4;

End;

Where:E-atrue/falseexpressionI-conditionalinstructions

Example

IfUpTrendisfalsethensell:

IfUpTrend=FalseThenSellNextBarMarket;

IfUpTrendistruethenbuy,otherwisesellshort:

146

Page 147: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IfUpTrendThenBuyNextBarMarketElseSellShortNextBarMarket;

IfUpTrendistruethenbuy,otherwisesellshort:

IfUpTrendThenBeginBuyNextBarMarket;End

ElseBegin

SellShortNextBarMarket;End;

147

Page 148: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NotUsedinTrue/Falsestatements:negative

Example

Condition1=True;

Condition2=NotCondition1;

AssignstoCondition2valueoppositetoCondition1.

148

Page 149: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OrAlogical(Boolean)operatorthatreturnsTrueifoneorbothofitsoperandsaretrue.Logicaloperatorsareusedinlogical(Boolean)expressionsthatoperatewithtrue/falsevalues.

Usage

E1OrE2

Where:E-true/falseexpressions

Example

2=1Or2>2willreturnavalueofFalse

TrueOrFalseOrFalsewillreturnavalueofTrue

149

Page 150: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OverSameasAbove

150

Page 151: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

switchPartofswitch-caseoperator.

Usage

Seeinexample

Example

switchgetplotcolor(1)begincasegreen:print("Indicatoringreenzoneonbar",currentbar);casered:print("Indicatorinredzoneonbar",currentbar);casered:print("Indicatorisneutralonbar",currentbar);end;

151

Page 152: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ThenUsedincombinationwithIftoformaconditionalstatementthatexecutesspecificinstructionsifalogicalexpressionistrue.

FormoreinformationseeIf.

Usage

IfEThenI

Where:E-atrue/falseexpressionI-conditionalinstructions

Example

IfUpTrendisfalsethensell:

IfUpTrend=FalseThenSellNextBarMarket;

152

Page 153: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ToUsedincombinationwithFortoformaloopstatementthatwillexecuteasetofinstructionsrepeatedlyuntiltheloopcountreachesthespecifiedfinalvalue.

Tospecifiesthatthevalueofthecountervariableistobeincreasedbyoneonthecompletionofeachloop.

FormoreinformationseeFor.

Usage

ForCounter=IValueToFValueBeginI1;I2;

End;

Where:Counter-anumericalvariableusedstoretheloopcountIValue-anumericalexpressionspecifyingtheinitialcountervalueFValue-anumericalexpressionspecifyingthefinalcountervalue

Example

Addthehighpricesofthelast10barstotheHighPriceSumvariable:

ForBarBackNo=0To9BeginHighPriceSum=HighPriceSum+High[BarBackNo];End;

153

Page 154: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueAlogical(Boolean)value.Logicalvaluesareusedinlogical(Boolean)expressionsandfortrue/falseinputs.

Usage

True

Example

TrueOrFalsewillreturnavalueofTrue

2=2willreturnavalueofTrue

DeclareLogicalVarasatrue/falsevariablewiththeinitialvalueoftrue:

Variable:LogicalVar(True);

DeclareOvernightasatrue/falseinputwiththedefaultvalueoftrue:

Input:Overnight(True);

154

Page 155: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

UnderSameasBelow

155

Page 156: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

WhileUsedincombinationwithBeginandEndtoformaconditionalloopstatementthatwillexecuteasetofinstructionsrepeatedlyaslongasalogicalexpressionistrue.Ifthelogicalexpressionisnottrue,theinstructionswillnotbeexecuted.

BeginandEndstatementsareusedtogroupinstructionsforconditionalexecution;aBeginmustalwaysbefollowedbyanEnd.

Beginshouldnotbefollowedbyasemicolon(;),codelineswithinaninstructiongroupshouldendwithasemicolon(;),andEndshouldbefollowedbyasemicolon(;).

Usage

WhileEBeginI1;I2;

I3;

End;

Where:E-atrue/falseexpressionI-conditionalinstructions

Example

Addthehighpricesofthelast10barstotheHighPriceSumvariable:

BarBackNo=0;WhileBarBackNo<10BeginHighPriceSum=HighPriceSum+High[BarBackNo];BarBackNo=BarBackNo+1;End;

156

Page 157: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AUD

Constantusedtodesignatethecurrency"AustralianDollar".

Usage

AUD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"AustralianDollar".

condition1=SymbolCurrencyCode=AUD;

157

Page 158: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CAD

Constantusedtodesignatethecurrency"CanadianDollar".

Usage

CAD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"CanadianDollar".

condition1=SymbolCurrencyCode=CAD;

158

Page 159: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CHF

Constantusedtodesignatethecurrency"SwissFranc".

Usage

CHF

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"SwissFranc".

condition1=SymbolCurrencyCode=CHF;

159

Page 160: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Convert_Currency

ReturnstheSrcMoneysum,setintheSrcCurrencycurrency,intheDstCurrencycurrencyusingthecross-rateattheDateTimedateandtime.

Usage

Convert_Currency(DateTime,SrcCurrency,DstCurrency,SrcMoney);

Where:

DateTime-dateandtimesetintheDateTimeformat

SrcCurrency-initialcurrencyusedforconversion

DstCurrency-currencytowhichthesumwillbeconvertedto

SrcMoney-fundsininitialcurrency(SrcCurrency)tobeconvertedtoDstCurrency

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Convert_Currency(39448.25000000,GBP,USD,12.34);willreturn24.48,whichmeansthat:on1/1/2008:12.34GBPwasequalto24.48USD.

160

Page 161: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EUR

Constantusedtodesignatethecurrency"Euro".

Usage

EUR

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"Euro".

condition1=SymbolCurrencyCode=EUR;

161

Page 162: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GBP

Constantusedtodesignatethecurrency"BritishPound".

Usage

GBP

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"BritishPound".

condition1=SymbolCurrencyCode=GBP;

162

Page 163: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HKD

Constantusedtodesignatethecurrency"HongKongDollar".

Usage

HKD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"HongKongDollar".

condition1=SymbolCurrencyCode=HKD;

163

Page 164: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

JPY

Constantusedtodesignatethecurrency"JapaneseYen".

Usage

JPY

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"JapaneseYen".

condition1=SymbolCurrencyCode=JPY;

164

Page 165: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NOK

Constantusedtodesignatethecurrency"NorwegianKrone".

Usage

NOK

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"NorwegianKrone".

condition1=SymbolCurrencyCode=NOK;

165

Page 166: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

None

Constantusedtodesignatethatcurrencywasnotindicated.

Usage

None

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

ChecksifthecurrencyofthesymbolusedforthecalculationisnotindicatedinQuoteManagersettings.

condition1=SymbolCurrencyCode=None;

166

Page 167: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NZD

Constantusedtodesignatethecurrency"NewZealandDollar".

Usage

NZD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"NewZealandDollar".

condition1=SymbolCurrencyCode=NZD;

167

Page 168: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_CurrencyCode

ReturnscurrencycodefromPortfoliosettings(View->PortfolioSettings)

Usage

Portfolio_CurrencyCode

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

ChecksifthecurrencyofportfolioaccountusedforcalculationisUSDollar.

condition1=Portfolio_CurrencyCode=USD;

168

Page 169: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SEK

Constantusedtodesignatethecurrency"SwedishKrona".

Usage

SEK

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"SwedishKrona".

condition1=SymbolCurrencyCode=SEK;

169

Page 170: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SGD

Constantusedtodesignatethecurrency"SingaporeDollar".

Usage

SGD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"SingaporeDollar".

condition1=SymbolCurrencyCode=SGD;

170

Page 171: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SymbolCurrencyCode

ReturnscurrencycodefromQuoteManagersymbolsettings(EditSymbol...->Settings->Currency)

Usage

SymbolCurrencyCode

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

ChecksifthecurrencyofthesymbolusedforcalculationisUSDollar.

condition1=SymbolCurrencyCode=USD;

171

Page 172: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TRY_

Constantusedtodesignatethecurrency"TurkishLira".

Usage

TRY_

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"TurkishLira".

condition1=SymbolCurrencyCode=TRY_;

172

Page 173: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

USD

Constantusedtodesignatethecurrency"USDollar".

Usage

USD

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"USDollar".

condition1=SymbolCurrencyCode=USD;

173

Page 174: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ZAR

Constantusedtodesignatethecurrency"SouthAfricanRand".

Usage

ZAR

Notes

Thebase14currenciescanbedesignatedbyconstants.

Example

Checksifthecurrencyofthesymbolusedforthecalculationis"SouthAfricanRand".

condition1=SymbolCurrencyCode=ZAR;

174

Page 175: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AgoUsedincombinationwithBarorBarsandanumericalexpressiontoreferencethebaraspecifiednumberofbarsbackfromthecurrentbar.

BarsAgocanalsobespecifiedbyusingthebaroffsetnotationthatconsistsofanumericalexpressionenclosedinsquarebrackets.

Usage

NBarsAgo

or:

[N]

Where:N-anumericalexpressionspecifyingthenumberofbarsbacktoreference

Example

Plottheclosingpriceofthepreviousbar:

Plot1(CloseOf1BarAgo,"Previousbar'sclose");

Plottheclosingpriceoftwobarsago:

Plot1(Close[2],"Close2barsago");

175

Page 176: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarUsedincombinationwithThis,Next,orAgotoreferenceaspecificbar.

Usage

Bar

Example

CloseOf1BarAgowillreturntheclosingpriceofthepreviousbar

Buyauser-setnumberofsharesoncloseofthisbar:

BuyThisBarOnClose;

Buyauser-setnumberofsharesonopenofnextbar:

BuyNextBarOnOpen;

176

Page 177: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarInterval

Returnsanumericalvalue,indicatingthenumberofresolutionunits(barinterval)ofthedataseriesthatthestudyisappliedto.

ReturnsthenumberofTicks,Contracts,Points,Changes,Seconds,Minutes,Hours,Days,Weeks,Months,Quarters,orYears,dependingonthechartresolution;avalueof5willbereturnedfora5-secondaswellasfora5-tickchart.

Usage

BarInterval

Example

Assignavalue,indicatingthenumberofresolutionunits(barinterval)ofthedataseriesthatthestudyisappliedto,toValue1variable:

Value1=BarInterval;

177

Page 178: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSameasBar

178

Page 179: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarStatusReturnsanumericalvalue,indicatingthestatusofthemostrecenttickinthecurrentbarofthespecifieddataseries.

Avalueof0indicatesthatthetickistheopeningtickofthebar,1indicatesthatthetickiswithinthebar,and2indicatesthatthetickistheclosingtickofthebar.

Usage

BarStatus(DataNum)

Where:DataNum-anumericalexpressionspecifyingthedatanumberoftheseries

IfDataNumisnotspecified,avalueforthecurrentdataserieswillbereturned.

Example

BarStatus(1)willreturnavalueof2ifthecurrenttickinthedataserieswiththedatanumber1istheclosingtickofabar

179

Page 180: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarType

Returnsanumericalvalue,indicatingtheresolutionunitsofthedataseriesthatthestudyisappliedto.

Usage

BarTypeThefollowingvaluesarereturnedforeachtypeofresolutionunits:

0Ticks(Ticks&Contracts)1Intra-Day(Seconds,Minutes,&Hours)2Days3Weeks4Months,Quarters,&Years5Points,Changes,Point&Figure6(Reservedforfutureuse)7(Reservedforfutureuse)8Kagi9(Reservedforfutureuse)10LineBreak11(Reservedforfutureuse)12(Reservedforfutureuse)13Renko256-HeikinAshi

Example

Assignavalue,indicatingtheresolutionunitsofthedataseriesthatthestudyisappliedto,toValue1variable:

Value1=BarType;

180

Page 181: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarType_ex

AnextendedversionofBarType.Indicatestheresolutionunitsmorespecifically.

Returnsanumericalvalue,indicatingtheresolutionunitsofthedataseriesthatthestudyisappliedto.

Usage

BarType_exThefollowingvaluesarereturnedforeachtypeofresolutionunits:

1Ticks2Minutes3Hours4Days5Weeks6Months7Years8Volume9Seconds10Quarters11Points12Change13Points(Original)14-Point&Figure15-Kagi16-LineBreak17-Renko18-HeikinAshi

Example

Assignavalue,indicatingtheresolutionunitsofthedataseriesthatthestudyisappliedto,toValue1variable:

Value1=BarType_ex;

181

Page 182: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

182

Page 183: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BigPointValueReturnsanumericalvalue,indicatingthecurrencyvalueofasinglewholeunitpricechangeforthedataseriesthatthestudyisappliedto.

Usage

BigPointValue

Notes

BigPointValue=PointValue×PriceScale

Example

BigPointValuewillreturn1forGoogle

BigPointValuewillreturn50forE-miniS&P;500

183

Page 184: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BoxSize

Returnstheprice-basedintervalsettingassociatedwiththespecifiedprice-basedcharttypeanindicatororsignalisappliedto.

ThisvalueissetintheChartTypesectionoftheSettingstabwithintheFormatInstrumentdialogforachart.

Usage

BoxSize

Parameters

ChartType ValueReturnedPoint&Figure BoxSizevaluePoint PointvalueRenko BoxSizevalue

Example

Boxsizewillreturnavalueof3forRenkochartwiththeBoxSizeequal3.

Boxsizewillreturnavalueof0forKagiorregularresolutionscharts.

184

Page 185: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CSameasClose

185

Page 186: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Call

ConstantusedtodesignatetheCalloptioninstrument.

Usage

Call

Notes

ThePutoptionscouldbedesignatedbythePutconstant.

Example

ChecksifthesymbolusedforthecalculationisaCalloption.

condition1=OptionType=Call;

186

Page 187: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Category

Returnsanumericalvalue,indicatingthecategory(financialinstrumenttype)ofthesymbolthatstudyisappliedto.

Usage

Category

Thefollowingvaluesarereturnedforeachcategory:

0Future1FutureOption2Stock3StockOption4Index5CurrencyOption6MutualFund7MoneyMarketFund8IndexOption9Cash10Bond11Spread12Forex14Composite

Example

Assignavalue,indicatingthetypeofsymbolthatthestudyisappliedto,toValue1variable:

Value1=Category;

187

Page 188: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CloseReturnstheclosingprice.

Usage

Close

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Plottheclosingpriceofthecurrentbar:

Plot1(Close,"Close");

Plottheclosingpriceofthepreviousbar:

Plot1(CloseOf1BarAgo,"Previousbar'sclose");

Plottheclosingpriceoftwobarsago:

Plot1(Close[2],"Close2barsago");

188

Page 189: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentBarReturnsthenumberofthecurrentbar.

Eachbar,subsequenttotheinitialnumberofbarsspecifiedbytheMaximumBarsBacksetting,isassignedasequentialnumber;theinitialbarsspecifiedbythesettingarenotnumbered.

Forexample,ifMaximumBarsBackissetto20,the21stbarwillbeassignedanumberof1.

Usage

CurrentBar

Example

CurrentBarwillreturnthenumberofthecurrentbar

189

Page 190: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DSameasDate

190

Page 191: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyLimitRetainedforbackwardcompatibility.

191

Page 192: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DataUsedtospecifyaparticulardataseriesinamulti-symbolchart;eachdataseriesinamulti-symbolcharthasauniqueDataNumber.

Usage

DataN

Where:N-theDataNumberofthedataseries

Or:

Data(N)

Where:N-anumericalexpressionspecifyingtheDataNumberofthedataseries

Example

HighOfData2willreturnthehighpriceofabarinthedataserieswiththeDataNumberof2

HighOfData(2)willreturnthehighpriceofabarinthedataserieswiththeDataNumberof2

192

Page 193: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DataCompressionSameasBarType

193

Page 194: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Date

Returnsanumericalvalueindicatingtheclosingdateofabar.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Usage

Date

Example

Datewillreturnavalueof1071030forOctober30th,2007

Datewillreturnavalueof990402forApril2th,1999

194

Page 195: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTime

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

DateTimeisadouble-precisiondecimalvalue.Itallowsaccessingmillisecondtimestampsofthebar.

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Usage

DateTime

Example

DateTimewillreturn41422.74for5/28/201308:41:11.813

195

Page 196: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTimebarupdate

ReturnstimeofthelastupdateofthecurrentbarifBarMagnifiermodeison.

IfBarMagnifiermodeisoff,returnsthetimeofthecurrentbar(astheTimeproperty).

Usage

datetime_bar_update(data_stream)

Example

BarMagnifiermodeison.Timeanddateofthelastupdateofthecurrentbarare29.04.201310:53:59.154

print(datetime_bar_update:15:8)willreturn41393.45415687.

print(datetimetostring_ms(datetime_bar_update))willreturn"29.04.201310:53:59.154".

196

Page 197: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DayRetainedforbackwardcompatibility;replacedwithBar.

197

Page 198: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DaysRetainedforbackwardcompatibility;replacedwithBar.

198

Page 199: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DownTicksReturnsthetotalnumberofDownticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalDownvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

Adowntickisatickwiththepricelowerthentheprecedingtick,anddownvolumeisthevolumetradedondownticks.

WithBuildVolumeOnissettoTickCount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofDownticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

WithBuildVolumeOnissettoTradeVolume:

-theDownvolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalDownvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Pleasenotethatmostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedata.

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Usage

DownTicks

Example

199

Page 200: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotthenumberofDownticksinthecurrentbar(BuildVolumeOnissettoTickCount):

Plot1(DownTicks,"DownTicks");

PlottheDownvolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(DownTicks,"DownVolume");

200

Page 201: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExpirationDate

Returnsanumericalvalue,indicatingtheexpirationdateofthefinancialinstrumentthestudyisappliedto.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Forexample,thevaluereturnedforthedateofOctober30th,2008willbe1081030,andforApril2nd,1999willbe990402.

Usage

ExpirationDate

Avalidexpirationdatewillbereturnedforfuturesoroptionsonly.

Example

ExpirationDatewillreturnavalueof1081030forOctober30th,2008

ExpirationDatewillreturnavalueof990402forApril2nd,1999

201

Page 202: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExpirationDateFromVendor

Returnsanumericalvalue,indicatingtheexpirationdateofthefinancialinstrumentthestudyisappliedto.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Forexample,thevaluereturnedforthedateofOctober30th,2008willbe1081030,andforApril2nd,1999willbe990402.

Usage

ExpirationDateFromVendor

Avalidexpirationdatewillbereturnedforfuturesoroptionsonly.

Example

ExpirationDateFromVendorwillreturnavalueof1081030forOctober30th,2008

ExpirationDateFromVendorwillreturnavalueof990402forApril2nd,1999

202

Page 203: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetExchangeNameReturnsastringexpressioncontainingtheexchangenameforthesymbolthatthestudyisappliedto.

Usage

GetExchangeName

Example

GetExchangeNamewillreturn"NASD"forGoogle

GetExchangeNamewillreturn"CME"forE-miniS&P;500

203

Page 204: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetRTSymbolNameReturnsastringexpressioncontainingthenameofthereal-timesymbolthatthestudyisappliedtoincasethemergingoptionisenabled.IfthemergingoptionisdisabledreturnsthesamevalueastheNameproperty.Incaseofacustomfuturesinstrumentthenameofthelastcontractisreturned.

Usage

GetRTSymbolName

Example

GetRTSymbolNamewillreturn"GOOG"forGoogleifthemergingoptionisenabledandGoogleisconfiguredasthereal-timeinstrument.

204

Page 205: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetSymbolNameReturnsastringexpressioncontainingthenameofthesymbolthatthestudyisappliedto.

Usage

GetSymbolName

Example

GetSymbolNamewillreturn"GOOG"forGoogle

205

Page 206: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HSameasHigh

206

Page 207: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HighReturnsthehighprice.

Usage

High

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Plotthehighpriceofthecurrentbar:

Plot1(High,"High");

Plotthehighpriceofthepreviousbar:

Plot1(HighOf1BarAgo,"Previousbar'shigh");

Plotthehighpriceoftwobarsago:

Plot1(High[2],"High2Barsago");

207

Page 208: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ISameasOpenInt

208

Page 209: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntervalType

Returnsanumericalvalue,indicatingtheresolutionintervalsofthedataseriesthatthestudyisappliedto.

Usage

IntervalType

Thefollowingvaluesarereturnedforeachtypeofresolutionunits:

0-Ticks(Ticks&Contracts)1-Intra-Day(Seconds,Minutes,&Hours)2-Days3-Weeks4-Months,Quarters,Years5-Points,Changes0-4-Point&Figure0-4-Kagi0-4-LineBreak0-Renko

Example

Toassignavalue,indicatingtheresolutionunitsofthedataseriesthestudyisappliedto,toValue1variable:

Value1=IntervalType;

209

Page 210: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntervalType_ex

AnextendedversionofIntervalType.

Indicatestheresolutionintervalsmorespecifically.

Returnsanumericalvalue,indicatingtheresolutionintervalsofthedataseriesthatthestudyisappliedto.

Usage

IntervalType_ex

Thefollowingvaluesarereturnedforeachtypeofresolutionunits:

1-Ticks2-Minutes3-Hours4-Days5-Weeks6-Months7-Years8-Volume9-Seconds10-Quarters11-Points12-Change13-Points(original)1-7,9,10-Point&Figure1-7,9,10-Kagi1-7,9,10-LineBreak1-Renko

Example

Toassignavalue,indicatingtheresolutionunitsofthedataseriesthestudyisappliedto,toValue1variable:

210

Page 211: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=IntervalType_ex;

211

Page 212: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LSameasLow

212

Page 213: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LowReturnsthelowprice.

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Usage

Low

Example

Plotthelowpriceofthecurrentbar:

Plot1(Low,"Low");

Plotthelowpriceofthepreviousbar:

Plot1(LowOf1BarAgo,"Previousbar'slow");

Plotthelowpriceoftwobarsago:

Plot1(Low[2],"Low2barsago");

213

Page 214: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MinMoveReturnsanumericalvalue,indicatingtheminimumfractionalunitpricechangeforthedataseriesthatthestudyisappliedto.

Usage

MinMove

Example

MinMovewillreturn1forGoogle

MinMovewillreturn25forE-miniS&P;500

MinMove*PointValuewillreturnthecurrencyvalue,correspondingtotheminimumpricemoveofashareorcontract

214

Page 215: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NextUsedincombinationwithBartoreferencethenextbar.

Usage

NextBar

Example

Buyauser-setnumberofsharesatMarketpriceonopenofnextbar:

BuyNextBarAtMarket;

215

Page 216: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OSameasOpen

216

Page 217: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenReturnsanumericalvalueindicatingtheopenopenprice.

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Usage

Open

Example

Plottheopenpriceofthecurrentbar:

Plot1(Open,"Open");

Plottheopenpriceofthepreviousbar:

Plot1(OpenOf1BarAgo,"Previousbar'sopen");

Plottheopenpriceoftwobarsago:

Plot1(Open[2],"Open2barsago");

217

Page 218: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenIntReturnstheopeninterestofthecurrentbarfortime-basedchartswithresolutionsof1dayormore.

Fortickandvolume-basedchartsandfortime-basedchartswithresolutionsof24hoursorless,OpenIntreturns:

-thevolumetradedonDowntickswillbereturnedifBuildVolumeOnissettoTradeVolume-thenumberofDownticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

Usage

OpenInt

Notes

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

OpenIntissupportedfortime-basedchartswithresolutionsof1dayormore.

Mostdatafeedsprovideonlyalimitedhistoryofvolumeandtickdata;storingreal-timefeeddatawillensuretheavailabilityofhistoricalvolumeandtickdata.

Example

Plottheopeninterestofthecurrentbar:

Plot1(OpenInt,"Openinterest");

Plottheopeninterestofthepreviousbar:

Plot1(OpenIntof1BarAgo,"Previousbar'sopeninterest");

218

Page 219: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plottheopeninterestoftwobarsago:

Plot1(OpenInt[2],"Openinterest2barsago");

219

Page 220: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OptionTypeReturnsthenumericalvalue,indicatingthePutorCallvalueforthedataseriesthatthestudyisappliedto.Iftheinstrumentisnotanoptioncontractthekeywordreturns0.

Usage

OptionType

Example

OptionTypewillreturn0forGoogle,sinceitisnotanoptioninstrument

OptionTypewillreturnthevalueofthePutconstantforanyPutoption,andthevalueoftheCallconstantforanyCalloption

220

Page 221: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PointReturnsadecimalnumericalvalue,equivalenttoasinglefractionalpriceunitforthedataseriesthatthestudyisappliedto.

Usage

Point

Notes

Point=1/PriceScale

Example

1Pointwillreturn0.01forGoogle

8Pointwillreturn0.08forE-miniS&P;500

8Pointwillreturn0.25forT-BondFutures

221

Page 222: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PointsSameasPoint

222

Page 223: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PointValueReturnsanumericalvalue,indicatingthecurrencyvalueofasinglefractionalunitpricechangeforthedataseriesthatthestudyisappliedto.

Usage

PointValue

Notes

PointValue=BigPointValue/PriceScale

Example

PointValuewillreturn0.01forGoogle

PointValuewillreturn0.50forE-miniS&P;500

223

Page 224: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PriceScaleReturnsanumericalvalue,indicatingthefractionalunitequivalentofasinglewholeunitpricechangeforthedataseriesthatthestudyisappliedto.

Usage

PriceScale

Notes

PriceScale=BigPointValue/PointValue

Example

PriceScalewillreturn100forGoogle

PriceScalewillreturn32forT-BondFutures

224

Page 225: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Put

ConstantusedtodesignatethePutoptioninstrument.

Usage

Put

Notes

TheCalloptionscouldbedesignatedbytheCallconstant.

Example

ChecksifthesymbolusedforthecalculationisaPutoption.

condition1=OptionType=Put;

225

Page 226: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RevSize

ReturnstheReversalofaPoint&Figurechart,theReversalofaKagichart,orthenumberofLineBreaksinaLineBreakchart.

ThisvalueissetintheChartTypesectionoftheSettingstabwithintheFormatInstrumentdialogforachart.

Usage

Notes

Example

RevSizereturns2ifthereversalsizeofaP&F;chartissetto2.

RevSizereturns5ifthenumberoflinebreaksforaLineBreakchartissetto5.

RevSizereturns4ifthereversalsizeofaKagichartissetto4%.

226

Page 227: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ScrollToBarCentersthechartonthespecifiedbar.

Usage

ScrollToBar(intDataN,intBarN)

Where:DataN-dataseriesnumber

BarN-barnumber

Example

ScrollToBar(2,98);

Willcenterthechartonthe98thbaroftheseconddataseries.

227

Page 228: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionLastBar

Returnsalogicalvalueindicatingwhetherthecurrentbaristhelastbarofthesession;returnsavalueofTrueifthecurrentbaristhelastbarofthesession,andavalueofFalseifthecurrentbarisnotthelastbarofthesession.

Usage

SessionLastBar

Example

Assignatrue/falsevalue,indicatingwhetherthecurrentbaristhelastbaronthechart,toLastBarvariable:

Variable:LastBar(False);LastBar=SessionLastBar;

228

Page 229: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StrikeReturnsthenumericalvalue,indicatingthestrikepriceforthedataseriesthatthestudyisappliedto.Iftheinstrumentisnotanoptioncontractthekeywordreturns0.

Usage

Strike

Example

Strikewillreturn0forGoogle,sinceitisnotanoptioninstrument

Strikewillreturn65fortheJanuary2012PutoptionforJohnson&Johnson(JNJ)atthestrikepriceis$65(JNJ120121P00065000)

229

Page 230: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Close

Returnstheclosingpriceofthebar.

Usage

Symbol_Close

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plottheclosingpriceofthecurrentbar:

Plot1(Symbol_Close,"Close");

Plottheclosingpriceofthepreviousbar:

Plot1(Symbol_Closeof1BarAgo,"PreviousBar'sClose");

Plottheclosingpriceoftwobarsago:

Plot1(Symbol_Close[2],"Close2barsago");

230

Page 231: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_CurrentBar

ReturnsanumericalvalueindicatingthenumberofthecurrentbarplusMaximumBarsBacksettingforthestudy.

Usage

Symbol_CurrentBar

Note

Eachbar,subsequenttotheinitialnumberofbarsspecifiedbytheMaximumBarsBacksetting,isassignedasequentialnumber;theinitialbarsspecifiedbythesettingarenotnumbered.

Forexample,ifMaximumBarsBackissetto20,the21stbarwillbeassignedanumberof1.

Example

Symbol_CurrentBar

WillreturnthenumberofthecurrentbarplusMaximumBarsBacksettingforthestudy.

231

Page 232: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Date

Returnsanumericalvalueindicatingtheclosingdateofabar.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

Symbol_Date

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Symbol_Datewillreturnavalueof1071030forOctober30th,2007

Symbol_Datewillreturnavalueof990402forApril2th,1999

232

Page 233: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_DownTicks

ReturnsthetotalnumberofDownticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalDownvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

Adowntickisatickwiththepricelowerthantheprecedingtick,anddownvolumeisthevolumetradedondownticks.

WithBuildVolumeOnissettoTickCount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofDownticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

WithBuildVolumeOnissettoTradeVolume:

-theDownvolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalDownvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Usage

Symbol_DownTicks

Note

Mostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedataTherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

233

Page 234: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotthenumberofDownticksinthecurrentbar(BuildVolumeOnissettoTickCount):

Plot1(Symbol_DownTicks,"DownTicks");

PlottheDownvolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(Symbol_DownTicks,"DownVolume");

234

Page 235: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_High

Returnsthehighpriceofthebar

Usage

Symbol_High

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plotthehighpriceofthecurrentbar:

Plot1(Symbol_High,"High");

Plotthehighpriceofthepreviousbar:

Plot1(Symbol_Highof1BarAgo,"PreviousBar'shigh");

Plotthehighpriceoftwobarsago:

Plot1(Symbol_High[2],"High2BarsAgo");

235

Page 236: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Length

Returnsanumericalvalueindicatingtheactualnumberofbarsofadataseriesonchart.

Usage

Symbol_Length

Note

Iftheseriesisnotupdatinginreal-time(nonewbarsappear),thekeywordreturnsthesamevalueoneachcalculation.Ifthechartupdatesinreal-timethekeywordreturnsthenumberofbarsavailablebythemomentscriptreferencesthekeyword.Itmeansthatthekeywordpossiblycanreturndifferentvaluesevenduringcalculationwithinthesamebar.

Example

Plot1(Symbol_Length,"Lengthofseries");

Plotsavalueof500ifthenumberofbarsofdataseriesis500andthereisnonewbarsappearPlotsavalueof501ifthenumberofbarsofdataseriesbecomes501becausenewbarappeared

236

Page 237: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Low

Returnsthelowpriceofthebar

Usage

Symbol_Low

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plotthelowpriceofthecurrentbar

Plot1(Symbol_Low,"Low");

Plotthelowpriceofthepreviousbar:

Plot1(Symbol_Lowof1BarAgo,"PreviousBar'slow");

Plotthelowpriceoftwobarsago:

Plot1(Symbol_Low[2],"Low2barsago");

237

Page 238: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Open

Returnsanumericalvalueindicatingtheopenpriceofthebar.

Usage

Symbol_Open

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plottheopenpriceofthecurrentbar:

Plot1(Symbol_Open,"Open");

Plottheopenpriceofthepreviousbar:

Plot1(Symbol_Openof1BarAgo,"Previousbar'sopen");

Plottheopenpriceoftwobarsago:

Plot1(Symbol_Open[2],"Open2barsago");

238

Page 239: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_OpenInt

Returnstheopeninterestofthecurrentbarfortickandvolume-basedcharts,andfortime-basedchartswithresolutionsof24hoursorless:

-thevolumetradedonDowntickswillbereturnedifBuildVolumeOnissettoTradeVolume-thenumberofDownticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

OpenIntissupportedfortime-basedchartswithresolutionsof1dayormore.

Usage

Symbol_OpenInt

Note

Mostdatafeedsprovideonlyalimitedhistoryofvolumeandtickdata;storingreal-timefeeddatawillensuretheavailabilityofhistoricalvolumeandtickdata.TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plottheopeninterestofthecurrentbar:

Plot1(Symbol_OpenInt,"OpenInterest");

Plottheopeninterestofthepreviousbar:

Plot1(Symbol_OpenIntof1BarAgo,"PreviousBar'sOpenInterest");

Plottheopeninterestoftwobarsago:

Plot1(Symbol_OpenInt[2],"OpenInterest2barsago");

239

Page 240: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

240

Page 241: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_TickIDThiskeywordcanbeusedtodistinguishbetweenthebarswiththesamedateandtimestamps.

Fortickandvolume-basedchartsreturnsthetickindexwithinasecond.Forresolutionshigherthan1Tickreturnstheindexofthelasttickwithinthebar.

Fortime-basedchartswithresolutionsof1secormorenotsupported.Returns0.

Realtimeticksstoredinthedatabasearebeingassignedthelast31bit-theidentifierofrealtimeaffiliation.InordertogettheSymbol_TickIDvaluewithoutrealtimeidentifieroneneedstocalculatetheremainderfromSymbol_TickIDvaluedivisionby2147483648.

value1=Mod(Symbol_TickID,2147483648);

Usage

Symbol_TickID

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plotsthetickindex(TickID)ofthelasttickwithinthecurrentbar:

Plot1(Symbol_TickID,"SymTickID");

241

Page 242: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Ticks

ReturnsthetotalnumberofticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

WithBuildVolumeOnissettoTickCount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

WithBuildVolumeOnissettoTradeVolume:

-thevolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Usage

Symbol_Ticks

Note

Mostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedataTherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plotthenumberofticksinthecurrentbar(BuildVolumeOnissettoTickCount):

Plot1(Symbol_Ticks,"Ticks");

242

Page 243: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plotthevolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(Symbol_Ticks,"Volume");

243

Page 244: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Time

Returnsanumericalvalueindicatingtheclosingtimeofthecurrentbar.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

Symbol_Time

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Symbol_Timewillreturnavalueof1015for10:15AM

Symbol_Timewillreturnavalueof1545for3:45PM

244

Page 245: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Time_S

Returnsanumericalvalueindicatingtheclosingtime,includingseconds,ofthecurrentbar.

Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

Usage

Symbol_Time_S

Note

TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Symbol_Time_Swillreturnavalueof101525for10:15:25AM

Symbol_Time_Swillreturnavalueof154500for3:45:00PM

245

Page 246: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_UpTicks

ReturnsthetotalnumberofUpticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalUpvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

Anuptickisatickwiththepricehigherthentheprecedingtick,andupvolumeisthevolumetradedonupticks.

WithBuildVolumeOnissettoTickCount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofUpticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

WithBuildVolumeOnissettoTradeVolume:

-theUpvolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalUpvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Usage

Symbol_UpTicks

Note

Mostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedataTherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

246

Page 247: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotthenumberofUpticksinthecurrentbar(BuildVolumeOnissettoTickCount):

Plot1(Symbol_UpTicks,"UpTicks");

PlottheUpvolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(Symbol_UpTicks,"UpVolume");

247

Page 248: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Symbol_Volume

Returnsthevolumeofthecurrentbar.

Fortickandvolume-basedcharts,andtime-basedchartswithresolutionsof24hoursorless:

-thevolumetradedonUptickswillbereturnedifBuildVolumeOnissettoTradeVolume-thenumberofUpticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

Fortime-basedchartswithresolutionsof1dayormore:

-thetotalvolumetradedwillbereturnedifBuildVolumeOnissettoTradeVolume-thetotalnumberofticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

Usage

Symbol_Volume

Note

Mostdatafeedsprovideonlyalimitedhistoryofvolumeandtickdata;storingreal-timefeeddatawillensuretheavailabilityofhistoricalvolumeandtickdata.TherangeofreturnedvaluesisnotlimitedbytheMaxBarsBacksetting.Thiskeywordcanreturnthevalueofanybarofthedataseries.

Example

Plotthevolumeofthecurrentbar

Plot1(Symbol_Volume,"Volume");

248

Page 249: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plotthevolumeofthepreviousbar:

Plot1(Symbol_Volumeof1BarAgo,"PreviousBar'sVolume");

Plotthevolumeoftwobarsago:

Plot1(Symbol_Volume[2],"Volume2barsago");

249

Page 250: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TSameasTime

250

Page 251: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ThisUsedincombinationwithBartoreferencethecurrentbar.

Usage

ThisBar

Example

Buyauser-setnumberofsharesoncloseofthisbar:

BuyThisBarOnClose;

251

Page 252: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TickIDThiskeywordcanbeusedtodistinguishbetweenthebarswiththesamedateandtimestamps.

Fortickandvolume-basedchartsreturnsthetickindexwithinasecond.Forresolutionshigherthan1Tickreturnstheindexofthelasttickwithinthebar.

Fortime-basedchartswithresolutionsof1secormorenotsupported.Returns0.

Realtimeticksstoredinthedatabasearebeingassignedthelast31bit-theidentifierofrealtimeaffiliation.InordertogettheTickIDvaluewithoutrealtimeidentifieroneneedstocalculatetheremainderfromTickIDvaluedivisionby2147483648.

value1=Mod(TickID,2147483648);

Usage

TickID

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Plotsthetickindex(TickID)ofthelasttickwithinthecurrentbar:

Plot1(TickID,"TickID");

252

Page 253: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TicksReturnsthetotalnumberofticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

WithBuildVolumeOnissettoTickCount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

WithBuildVolumeOnissettoTradeVolume:

-thevolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Pleasenotethatmostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedata.

Usage

Ticks

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Plotthenumberofticksinthecurrentbar(BuildVolumeOnissettoTickCount):

Plot1(Ticks,"Ticks");

253

Page 254: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plotthevolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(Ticks,"Volume");

254

Page 255: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Time

Returnsanumericalvalueindicatingtheclosingtimeofthecurrentbar.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

Time

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Timewillreturnavalueof1015for10:15AM

Timewillreturnavalueof1545for3:45PM

255

Page 256: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Time_s

Returnsanumericalvalueindicatingtheclosingtime,includingseconds,ofthecurrentbar.Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

Time_s

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Time_swillreturnavalueof101525for10:15:25AM

Time_swillreturnavalueof154500for3:45:00PM

256

Page 257: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TodayRetainedforbackwardcompatibility;replacedwithThisBar

257

Page 258: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

UpTicksReturnsthetotalnumberofUpticksforthecurrentbarifBuildVolumeOnissettoTickCount.

ReturnsthetotalUpvolumeforthecurrentbarifBuildVolumeOnissettoTradeVolume.

Anuptickisatickwiththepricehigherthentheprecedingtick,andupvolumeisthevolumetradedonupticks.

Withbuildvolumeonissettotickcount:

-thevalueof1willbereturnedfor1-tickcharts-thetotalnumberofUpticksinthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Withbuildvolumeonissettotradevolume:

-theUpvolumeofthecurrenttickwillbereturnedfor1-tickcharts-thetotalUpvolumeofthecurrentbarwillbereturnedformulti-tick,volume,andtime-basedcharts

Pleasenotethatmostdatafeedsprovideonlyalimitedhistoryoftickandvolumedata;storingreal-timefeeddatawillensuretheavailabilityofhistoricaltickandvolumedata.

Usage

UpTicks

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

PlotthenumberofUpticksinthecurrentbar(BuildVolumeOnissettoTick

258

Page 259: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Count):

Plot1(UpTicks,"UpTicks");

PlottheUpvolumeofthecurrentbar(BuildVolumeOnissettoTradeVolume):

Plot1(UpTicks,"UpVolume");

259

Page 260: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VSameasVolume

260

Page 261: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VolumeReturnsthevolumeofthecurrentbar.

Fortickandvolume-basedcharts,andtime-basedchartswithresolutionsof24hoursorless:

-thevolumetradedonUptickswillbereturnedifBuildVolumeOnissettoTradeVolume-thenumberofUpticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

Fortime-basedchartswithresolutionsof1dayormore:

-thetotalvolumetradedwillbereturnedifBuildVolumeOnissettoTradeVolume-thetotalnumberofticksinthecurrentbarwillbereturnedifBuildVolumeOnissettoTickCount

Pleasenotethatmostdatafeedsprovideonlyalimitedhistoryofvolumeandtickdata;storingreal-timefeeddatawillensuretheavailabilityofhistoricalvolumeandtickdata.

Usage

Volume

Note

TherangeofreturnedvaluesislimitedbytheMaxBarsBacksetting.

Example

Plotthevolumeofthecurrentbar:

Plot1(Volume,"Volume");

261

Page 262: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plotthevolumeofthepreviousbar:

Plot1(VolumeOf1BarAgo,"Previousbar'svolume");

Plotthevolumeoftwobarsago:

Plot1(Volume[2],"Volume2barsago");

262

Page 263: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

YesterdayRetainedforbackwardcompatibility.

263

Page 264: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ComputerDateTime

Returnsadouble-precisiondecimalDateTimevalueindicatingthecomputer'scurrentdateandtime.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

ComputerDateTime

Example

ComputerDateTimewillreturnavalueof39448.25000000for6:00AMonJanuary1st,2008

264

Page 265: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentDate

Returnsanumericalvalueindicatingthecomputer'scurrentdate.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Forexample,thevaluereturnedforthedateofOctober30th,2008willbe1081030.

Usage

CurrentDate

Example

CurrentDatewillreturnavalueof1081030forOctober30th,2008

265

Page 266: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentTime

Returnsanumericalvalue,indicatingthecomputer'scurrenttime.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

CurrentTime

Example

CurrentTimewillreturnavalueof1015for10:15AM

CurrentTimewillreturnavalueof1545for3:45PM

266

Page 267: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentTime_s

Returnsanumericalvalueindicatingthecomputer'scurrenttime,includingseconds.Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

CurrentTime_s

Example

CurrentTime_swillreturnavalueof101525for10:15:25AM

CurrentTime_swillreturnavalueof154500for3:45:00PM

267

Page 268: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTime2ELTime

ReturnsanumericalvalueindicatingthetimefromthespecifiedDateTimevalue.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DateTime2ELTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

DateTime2ELTime(39449.65625000)willreturnavalueof1545,indicating3:45PM

268

Page 269: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTime2ELTime_s

Returnsanumericalvalueindicatingthetime,includingseconds,fromthespecifiedDateTimevalue.Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DateTime2ELTime_s(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

DateTime2ELTime_s(39449.646354167)willreturnavalueof153045,indicating3:30:45PM

269

Page 270: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTimeToString

ReturnsastringexpressioncorrespondingtothespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DateTimeToString(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevaluetobeconvertedtoastringexpression

Notes

TheoutputexampleisinthedefaultUSregionaldateandtimeformat.DateandtimeformatsarecontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

Example

DateTimeToString(39448.25000000)willreturnthestring"1/1/20086:00:00AM"

270

Page 271: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateTimeToString_Ms

Returnsastringvalueindicatingdateandtimeofabarwithmillisecondprecision.

Usage

DateTimeToString_Ms(DT)

Where:DTisDateTimevalue.

Example

DateTimeToString_Ms(DateTime)willreturnastringvaluecorrespondingtothetimeandtimeofthecurrentbar

"5/28/201308:41:11.871".

271

Page 272: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateToJulian

ReturnsanumericalvaluecorrespondingtotheJulianDateequivalentofthespecifieddate.

ThedateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

JulianDateindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900.

Usage

DateToJulian(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinYYYMMddformat

Example

DateToJulian(1080101)willreturnavalueof39448,correspondingtothespecifieddateofJanuary1st,2008

DateToJulian(990402)willreturnavalueof36252,correspondingtothespecifieddateofApril2nd,1999

272

Page 273: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DateToString

Returnsastringexpressioncorrespondingtothedate(integer)portionofthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DateToString(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevaluetobeconvertedtoastringexpressionrepresentingthedate

Notes

TheoutputexampleisinthedefaultUSregionaldateformat.DateformatiscontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

Example

DateToString(39448.25000000)willreturnthestring"1/1/2008".

273

Page 274: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DayFromDateTime

ReturnsanumericalvalueindicatingthedayofthemonthforthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DayFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

DayFromDateTime(39449.25000000)willreturnavalueof2,indicatingthe2nddayofthemonthofJanuary,2008

274

Page 275: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DayOfMonth

Returnsanumericalvalue,indicatingthedayofthemonthofthespecifieddate.

ThedateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

DayOfMonth(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinYYYMMddformat

Example

DayOfMonth(1080101)willreturnavalueof1,indicatingthe1stdayofthemonthofJanuary,2008

DayOfMonth(990605)willreturnavalueof5,indicatingthe5thdayofthemonthofJune,1999

275

Page 276: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DayOfWeek

Returnsanumericalvalue,indicatingthedayoftheweekcorrespondingtothespecifieddate,where0=Sunday,1=Monday,etc.

TheDateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

DayOfWeek(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinYYYMMddformat

Example

DayOfWeek(1080101)willreturnavalueof2,indicatingTuesday,forJanuary1st,2008

DayOfWeek(990603)willreturnavalueof4,indicatingThursday,forJune3rd,1999

276

Page 277: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DayOfWeekFromDateTime

Returnsanumericalvalue,indicatingthedayoftheweekcorrespondingtothespecifiedDateTimevalue,where0=Sunday,1=Monday,etc.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

DayOfWeekFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

DayOfWeekFromDateTime(39448.25000000)willreturnavalueof2,indicatingTuesday,forJanuary1st,2008

277

Page 278: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ELDateToDateTime

Returnstheintegerportionofadouble-precisiondecimalDateTimevaluecorrespondingtothespecifiedELDate.

ELDateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

ELDateToDateTime(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinELYYYMMddformat

Example

ELDateToDateTime(1080101)willreturnavalueof39448.00000000,correspondingtothespecifieddateofJanuary1st,2008

ELDateToDateTime(990402)willreturnavalueof36252.00000000,correspondingtothespecifieddateofApril2nd,1999

278

Page 279: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ELTimeToDateTime

Returnsthefractionalportionofadouble-precisiondecimalDateTimevaluecorrespondingtothespecifiedtime.Thetimeisspecifiedinthe24-hourHHmmformat,where1300=1:00PM.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

ELTimeToDateTime(HHmm)

Where:HHmm-anumericalexpressionspecifyingthetime

Example

ELTimeToDateTime(1015)willreturnavalueof0.42708333,correspondingtothespecifiedtimeof10:15AM

ELTimeToDateTime(1545)willreturnavalueof0.65625000,correspondingtothespecifiedtimeof3:45PM

279

Page 280: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ELTimeToDateTime_s

Returnsthefractionalportionofadouble-precisiondecimalDateTimevaluecorrespondingtothespecifiedtime,includingseconds.Thetimeisspecifiedinthe24-hourHHmmssformat,where130000=1:00:00PM.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

ELTimeToDateTime_s(HHmmss)

Where:HHmmss-anumericalexpressionspecifyingthetime

Example

ELTimeToDateTime_s(101525)willreturnavalueof0.427372685,correspondingtothespecifiedtimeof10:15:25AM

ELTimeToDateTime_s(154500)willreturnavalueof0.656250000,correspondingtothespecifiedtimeof3:45:00PM

280

Page 281: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

El_DateStr

Returnsan8-characternumericalstringcorrespondingtothespecifieddate.ThestringisintheyyyyMMddformat,whereyyyyisthefour-digityear,MMisthemonth,andddisthedayofthemonth.

Usage

El_DateStr(dd,MM,yyyy)

Where:dd-anumericalexpressionspecifyingthedayofthemonthMM-anumericalexpressionspecifyingthemonthyyyy-afour-digitnumericalexpressionspecifyingtheyear

Example

El_DateStr(02,04,2008)willreturnthestring"20080402",correspondingtothespecifieddateofApril2nd,2008.

281

Page 282: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

El_DateToDateTimeSameastheElDateToDateTime

282

Page 283: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EL_TimeToDateTimeSameastheElTimeToDateTime

283

Page 284: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EL_TimeToDateTime_sSameasElTimeToDateTime_s

284

Page 285: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EncodeDate

Returnstheintegerportionofadouble-precisiondecimalDateTimevaluecorrespondingtothespecifieddate.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

EncodeDate(yy,MM,dd)

Where:yy-anumericalexpressionspecifyingthetwo-digityearMM-anumericalexpressionspecifyingthemonthdd-anumericalexpressionspecifyingthedayofthemonth

Example

EncodeDate(08,01,01)willreturnavalueof39448.00000000,correspondingtothespecifieddateofJanuary1st,2008

285

Page 286: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EncodeTime

Returnsthefractionalportionofadouble-precisiondecimalDateTimevaluecorrespondingtothespecifiedtime.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

EncodeTime(HH,mm,ss,mmm)

Where:HH-anumericalexpressionspecifyingthehoursin24-hourformatmm-anumericalexpressionspecifyingtheminutesss-anumericalexpressionspecifyingthesecondsmmm-anumericalexpressionspecifyingthemilliseconds

Example

EncodeTime(16,29,55,500)willreturnavalueof0.6874479167,correspondingtothespecifiedtimeof16:29:55.500

286

Page 287: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FormatDate

Returnsaformatedstringexpressioncorrespondingtothedate(integer)portionofthespecifiedDateTimevalue.

Theformatofthestringexpression,includingtheabbreviationsandseparators,isdefinedbythespecifiedformatstring.Theformatstringconsistsofoneormoreelementsarrangedinthedesiredorder.Eachelementrepresentsaparticularpartofthedateinaspecificformat.Spacesandseparatorcharacterstobeusedcanbeinsertedwithintheformatstring.

Usage

FormatDate("FormatString",DateTime)

Parameters

FormatString-aformatstring,specifyingtheformatoftheoutputstringexpressionrepresentingthedate

Thefollowingelementscanbeusedintheformatstring:

d Dayofmonthasdigitswithnoleadingzeroforsingle-digitdaysdd Dayofmonthasdigitswithleadingzeroforsingle-digitdaysddd Dayofweekasathree-letterabbreviationdddd DayofweekasitsfullnameM Monthasdigitswithnoleadingzeroforsingle-digitmonthsMM Monthasdigitswithleadingzeroforsingle-digitmonthsMMM Monthasathree-letterabbreviationMMMMMonthasitsfullnamey Yearaslasttwodigits,butwithnoleadingzeroforyearslessthan10yy Yearaslasttwodigits,butwithleadingzeroforyearslessthan10

yyyy Yearrepresentedbyfullfourdigits

DateTime-adouble-precisiondecimalDateTimevaluetobeconvertedtoastring

287

Page 288: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

expressionrepresentingthedate

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Example

FormatDate("dddd,MMMMdd,yyyy.",39469.250)willreturnthestring"Tuesday,January22,2008."

FormatDate("M/d/y",39469.250)willreturnthestring"1/22/8"

FormatDate("dd-MM-yy",39469.250)willreturnthestring"22-01-08"

FormatDate("Nextdddis:MMMdd",39469.250)willreturnthestring"NextTueis:Jan22"

288

Page 289: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FormatTime

Returnsaformatedstringexpressioncorrespondingtothetime(fractional)portionofthespecifiedDateTimevalue.

Theformatofthestringexpression,includingseparators,isdefinedbythespecifiedformatstring.Theformatstringconsistsofoneormoreelementsarrangedinthedesiredorder.Eachelementrepresentsaparticularunitoftimeinaspecificformat.Spacesandseparatorcharacterstobeusedcanbeinsertedwithintheformatstring.

Usage

FormatTime("FormatString",DateTime)

Parameters

FormatString-aformatstring,specifyingtheformatoftheoutputstringexpressionrepresentingthetime

Thefollowingelementscanbeusedintheformatstring:

h Hoursin12-hourAM/PMformatwithnoleadingzeroforsingle-digithourshh Hoursin12-hourAM/PMformatwithleadingzeroforsingle-digithoursH Hoursin24-hourformatwithnoleadingzeroforsingle-digithoursHH Hoursin24-hourformatwithleadingzeroforsingle-digithoursm Minuteswithnoleadingzeroforsingle-digitminutesmmMinuteswithleadingzeroforsingle-digitminutess Secondswithnoleadingzeroforsingle-digitsecondsss Secondswithleadingzeroforsingle-digitsecondst OnecharacterAM/PMdesignatortt MulticharacterAM/PMdesignator

DateTime-adouble-precisiondecimalDateTimevaluetobeconvertedtoastringexpressionrepresentingthetime

289

Page 290: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Example

FormatTime("hh:mm:sst",39469.6674)willreturnthestring"04:01:03P"

FormatTime("htt",39469.6674)willreturnthestring"4PM"

FormatTime("HH:mm",39469.6674)willreturnthestring"16:01"

FormatTime("mMINsSEC",39469.6674)willreturnthestring"1MIN3SEC"

290

Page 291: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Friday

Returnsanumericalvalueof5,correspondingtoFriday.

Usage

Friday

Example

Fridaywillreturnavalueof5

291

Page 292: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HoursFromDateTime

ReturnsanumericalvalueindicatingthehoursfromthespecifiedDateTimevalue.Thehoursareindicatedinthe24-hourformat,where13=1PM.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

HoursFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

HoursFromDateTime(39449.85000000)willreturnavalueof20,indicating8PM

292

Page 293: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IncMonth

ReturnsanumericalvaluecorrespondingtoaJuliandatethatisafterorbeforethespecifiedJuliandatebyaspecifiednumberofcalendarmonths.

JulianDateindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900.

Usage

IncMonth(JulianDate,M)

Where:JulianDate-anumericalexpressionspecifyingtheJulianDateM-anumericalexpressionspecifyingthenumberofcalendarmonthsfromthespecifiedJuliandate;ifthevalueofMis;positive,adateafterthespecifieddatewillbereturned;ifthevalueofMis;negative,adatebeforethespecifieddatewillbereturned

Example

IncMonth(39417,1)willreturnavalueof39448,correspondingtoJanuary1st,2008,onecalendarmonthafterthespecifieddateofDecember1st,2007

IncMonth(36252,-2)willreturnavalueof36193,correspondingtoFebruary2nd,1999,twocalendarmonthsbeforethespecifieddateofApril2nd,1999

293

Page 294: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

JulianToDate

ReturnsanumericalvaluecorrespondingtotheELDateequivalentofthespecifiedJulianDate.

JulianDateindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900.

ELDateisintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

JulianToDate(JulianDate)

Where:JulianDate-anumericalexpressionspecifyingtheJulianDate

Example

JulianToDate(39448)willreturnavalueof1080101,correspondingtothespecifieddateofJanuary1st,2008

JulianToDate(36252)willreturnavalueof990402,correspondingtothespecifieddateofApril2nd,1999

294

Page 295: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcDateTime

ReturnsanumericalvalueindicatingtheclosingDateTimeofthelastcompletedbar.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

LastCalcDateTime

Example

LastCalcDateTimewillreturnavalueof41871.83333forthelastbarcompletionat08/20/20148:00PM

295

Page 296: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcJDate

ReturnsanumericalvalueindicatingtheJuliandateforthelastcompletedbar.

JulianDateindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900.

Usage

LastCalcJDate

Example

LastCalcJDatewillreturnavalueof39448forthelastbarcompletiondateofJanuary1st,2008

296

Page 297: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcMMTime

Returnsanumericalvalueindicatingtheclosingtimeofthelastcompletedbar.Thetimeisindicatedasthenumberofminutesthathavepassedsincemidnight.

Usage

LastCalcMMTime

Example

LastCalcMMTimewillreturnavalueof850forthelastbarcompletiontimeof2:10PM

297

Page 298: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcmSTime

Returnsanumericalvalueindicatingtheclosingtimeofthelastcompletedbar.Thetimeisindicatedasthenumberofmillisecondsthathavepassedsincemidnight.

Usage

LastCalcmSTime

Example

LastCalcmSTimewillreturnavalueof51030150forthelastbarcompletiontimeof2:10:30.150PM

298

Page 299: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastCalcSSTime

Returnsanumericalvalueindicatingtheclosingtimeofthelastcompletedbar.Thetimeisindicatedasthenumberofsecondsthathavepassedsincemidnight.

Usage

LastCalcSSTime

Example

LastCalcSSTimewillreturnavalueof51030forthelastbarcompletiontimeof2:10:30PM

299

Page 300: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MilliSecondsFromDateTime

ReturnsanumericalexpressionindicatingthemillisecondstampofDateTimevalue.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

MilliSecondsFromDateTime(DT)

Where:DT-isaDateTimevalue.

Example

MillisecondsFromDateTime(DateTtime)willreturn687.00ifthetimestampofthecurrentbaris11:57:07.687

300

Page 301: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MinutesFromDateTime

ReturnsanumericalvalueindicatingtheminutesfromthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

MinutesFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

MinutesFromDateTime(39449.35000000)willreturnavalueof24,indicating24minutesafter8AM

301

Page 302: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Monday

Returnsanumericalvalueof1,correspondingtoMonday.

Usage

Monday

Example

Mondaywillreturnavalueof1

302

Page 303: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Month

Returnsanumericalvalue,indicatingthemonthofthespecifiedELDate.

ELDateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

Month(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinELYYYMMddformat

Example

Month(1080101)willreturnavalueof1,indicatingthemonthofJanuary

Month(990605)willreturnavalueof6,indicatingthemonthofJune

303

Page 304: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MonthFromDateTime

ReturnsanumericalvalueindicatingthemonthforthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

MonthFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

MonthFromDateTime(39600.25000000)willreturnavalueof6,indicatingthemonthofJune

304

Page 305: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Saturday

Returnsanumericalvalueof6,correspondingtoSaturday.

Usage

Saturday

Example

Saturdaywillreturnavalueof6

305

Page 306: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SecondsFromDateTime

ReturnsanumericalvalueindicatingthesecondsfromthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

SecondsFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

SecondsFromDateTime(39449.35440000)willreturnavalueof20,indicating20secondsfrom8:30:20AM

306

Page 307: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringToDate

Returnstheintegerportionofadouble-precisiondecimalDateTimevalue,correspondingtothespecifieddate.Thedateisspecifiedbyastringexpression"MM/dd/yy"*or"MM/dd/yyyy"*,whereMM*isthemonth,dd*istheday,andyyoryyyyisatwo-digitorfour-digityear.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

StringToDate("MM/dd/yy")

or:

StringToDate("MM/dd/yyyy")

Where:MM-month*dd-dayofthemonth*yy-atwo-digityearyyyy-afour-digityear

Notes

*DescribedusageandexamplesareforthedefaultUSregionaldateformat.IfthedefaultUKregionalformatisselected,thedateswillbeindd/MM/yyanddd/MM/yyyyformatinstead.DateformatiscontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

Example

StringToDate("01/01/2008")willreturnavalueof39448.00000000,correspondingtothespecifieddateofJanuary1st,2008

307

Page 308: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringToDate("04/04/99")willreturnavalueof36254.00000000,correspondingtothespecifieddateofApril4th,1999

308

Page 309: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringToDateTime

Returnsadouble-precisiondecimalDateTimevaluecorrespondingtothespecifieddateandtime.Thedateandtimearespecifiedbyastringexpression"MM/dd/yyhh:mm:sstt"*or"MM/dd/yyyyhh:mm:sstt"*,whereMM*isthemonth,dd*istheday,yyoryyyyisatwo-digitorfour-digityear,hhisthehoursin12-hourAM/PMformat,mmistheminutes,ssistheseconds,andttistheAM/PMdesignator.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

StringToDateTime("MM/dd/yyhh:mm:sstt")

or:

StringToDateTime("MM/dd/yyyyhh:mm:sstt")

Where:MM-month*dd-dayofthemonth*yy-atwo-digityearyyyy-afour-digityearhh-hoursmm-minutesss-secondstt-AM/PMdesignator

Notes

*DescribedusageandexamplesareforthedefaultUSregionaldateandtimeformats.IfthedefaultUKregionalformatisselected,thedateswillbeindd/MM/yyanddd/MM/yyyyformatinstead.DateandtimeformatsarecontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

309

Page 310: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

StringToDateTime("01/01/200808:00:00AM")willreturnavalueof39448.33333333,correspondingto08:00:00AMonJanuary1st,2008

StringToDateTime("04/04/9904:48:00PM")willreturnavalueof36254.70000000,correspondingto04:48:00PMonApril4th,1999

310

Page 311: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringToDTFormatted

ReturnstheDateTimevalueforthestringinaparticularformat.Theformatofthestringexpression,includingtheabbreviationsandseparators,isdefinedbythespecifiedformatstring.Theformatstringconsistsofoneormoreelementsarrangedinthedesiredorder.Eachelementrepresentsaparticularpartofthedateinaspecificformat.Spacesandseparatorcharacterstobeusedcanbeinsertedwithintheformatstring.

Usage

StringToDTFormatted("DateTimeString","FormatString")

Parameters

DateTimeString-timeanddatevalueinstringformat.

FormatString-aformatstring,specifyingtheformatoftheoutputstringexpressionrepresentingthedateandtime.

Thefollowingelementscanbeusedintheformatstring:

d-dayofmonthasdigitswithnoleadingzeroforsingle-digitdaysdd-dayofmonthasdigitswithleadingzeroforsingle-digitdaysddd-dayofweekasathree-letterabbreviationdddd-dayofweekasitsfullnameM-monthasdigitswithnoleadingzeroforsingle-digitmonthsMM-onthasdigitswithleadingzeroforsingle-digitmonthsMMM-monthasathree-letterabbreviationMMMM-monthasitsfullnamey-yearaslasttwodigits,butwithnoleadingzeroforyearslessthan10yy-yearaslasttwodigits,butwithleadingzeroforyearslessthan10yyyy-yearrepresentedbyfullfourdigitsh-hoursin12-hourAM/PMformatwithnoleadingzeroforsingle-digithourshh-hoursin12-hourAM/PMformatwithleadingzeroforsingle-digithoursH-hoursin24-hourformatwithnoleadingzeroforsingle-digithours

311

Page 312: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

HH-hoursin24-hourformatwithleadingzeroforsingle-digithoursm-minuteswithnoleadingzeroforsingle-digitminutesmm-minuteswithleadingzeroforsingle-digitminutess-secondswithnoleadingzeroforsingle-digitsecondsss-secondswithleadingzeroforsingle-digitsecondst-onecharacterAM/PMdesignatortt-multicharacterAM/PMdesignator

Returnvalue

DateTime-adouble-precisiondecimalDateTimevalue,correspondingtothefirststringparameterwithasecondstringparameterformatappliedtoit.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Note

Attention!Checkifthereturnedvalueiscorrect!Ifconversionfails,thefunctionreturns-1.

Example

StringToDTFormatted("22/11/201315:35","dd/MM/yyyHH:mm")willreturn41600.649305555555,whichrepresentsNovember22nd2013,3:35PM.

StringToDTFormatted("02/17/11","MM/dd/yy")willreturn40591,whichrepresentsFebruary17th2011.

StringToDTFormatted("17/02/11","MM/dd/yy")willreturn-1,stringconversiontoDateTimeformatfailed.

StringToDTFormatted("4:00PM","h:mmtt")willreturn2.666666666666667,whichrepresentstheminimumvalueofJulianDate=January1st1900,4:00PM.

312

Page 313: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringToTime

Returnsthefractionalportionofadouble-precisiondecimalDateTimevalue,correspondingtothespecifiedtime.

Thetimeisspecifiedbyastringexpression"hh:mm:sstt",wherehhisthehoursinthe12-hourAM/PMformat,mmistheminutes,ssistheseconds,andttistheAM/PMdesignator.

TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Usage

StringToTime("hh:mm:sstt")

Where:hh-hoursinthe12-hourAM/PMformatmm-minutesss-secondstt-AM/PMdesignator

Notes

DescribedusageandexamplesareforthedefaultUSregionaltimeformat.TimeformatiscontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

Example

StringToTime("08:00:00AM")willreturnavalueof0.33333333

StringToTime("04:48:00PM")willreturnavalueof0.70000000

313

Page 314: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sunday

Returnsanumericalvalueof0,correspondingtoSunday.

Usage

Sunday

Example

Sundaywillreturnavalueof0

314

Page 315: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Thursday

Returnsanumericalvalueof4,correspondingtoThursday.

Usage

Thursday

Example

Thursdaywillreturnavalueof4

315

Page 316: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Time2Time_s

ReturnsanumericalvalueindicatingthetimeintheHHmmssformat,correspondingtothespecifiedtimeintheHHmmformat.

Thetimeisreturnedinthe24-hourHHmmssformat,where130000=1:00:00PM,andspecifiedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

Time2Time_s(HHmm)

Where:HHmm-anumericalexpressionspecifyingthetime

Example

Time2Time_s(1015)willreturnavalueof101500

Time2Time_s(1545)willreturnavalueof154500

316

Page 317: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TimeToString

Returnsastringexpressioncorrespondingtothetime(fractional)portionofthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

TimeToString(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevaluetobeconvertedtoastringexpressionrepresentingthetime

Notes

TheoutputexampleisinthedefaultUSregionaltimeformat.TimeformatiscontrolledbytheRegionalOptionssettingsthatcanbeaccessedfromtheControlPaneloftheWindowsXPoperatingsystem.

Example

TimeToString(39448.75000000)willreturnthestring"6:00PM"

317

Page 318: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Time_s2Time

ReturnsanumericalvalueindicatingthetimeintheHHmmformat,correspondingtothespecifiedtimeintheHHmmssformat;thesecondsaretruncated.

Thetimeisreturnedinthe24-hourHHmmformat,where1300=1:00PM,andspecifiedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

Time_s2Time(HHmmss)

Where:HHmmss-anumericalexpressionspecifyingthetime

Example

Time_s2Time(101520)willreturnavalueof1015

Time_s2Time(154548)willreturnavalueof1545

318

Page 319: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tuesday

Returnsanumericalvalueof2,correspondingtoTuesday.

Usage

Tuesday

Example

Tuesdaywillreturnavalueof2

319

Page 320: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Wednesday

Returnsanumericalvalueof3,correspondingtoWednesday.

Usage

Wednesday

Example

Wednesdaywillreturnavalueof3

320

Page 321: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Year

Returnsanumericalvalue,indicatingtheyearofthespecifiedELDate.

ELDateisspecifiedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

Year(YYYMMdd)

Where:YYYMMdd-anumericalexpression,specifyingthedateinELYYYMMddformat

Example

Year(1080101)willreturnavalueof108,indicatingtheyearof2008

Year(990605)willreturnavalueof99,indicatingtheyearof1999

321

Page 322: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

YearFromDateTime

ReturnsanumericalvalueindicatingtheyearforthespecifiedDateTimevalue.

TheintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

Usage

YearFromDateTime(DateTime)

Where:DateTime-adouble-precisiondecimalDateTimevalue

Example

YearFromDateTime(39449.25000000)willreturnavalueof2008,indicatingtheyearof2008

322

Page 323: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ArrayDeclaresoneormorenamesasarrays,containingmultiplevariabledataelements;specifiesthearraystructure,dataelementstypeandinitialvalue,updatebasis,anddatanumber,foreachofthearrays.

Dataelementstypecanbenumerical,string,ortrue/false.

Thenumberofelementsinanarraycanbefixedordynamic(unlimited).

Inarrayswithafixednumberofelements,theelementscanbearrangedinsingleormultipledimensions.Aone-dimensional10-elementarraycontains10elements,atwo-dimensional10-elementby10-elementarraycontains100elements,athree-dimensional10by10by10elementarraycontains1000elements,afour-dimensional10by10by10by10elementarraycontains10000elements,etc.ThemaximumnumberofarraydimensionsinPowerLanguageis9.

Eachelementinanarrayisreferencedbyoneormoreindexnumbers,oneforeachofthedimensions.Indexingstartsat0foreachofthedimensions.

Dynamicarrays(arrayswithanunlimitednumberofelements)areone-dimensional,andareinitializedatdeclarationashavingonlyoneelement.DeclareddynamicarrayscanberesizedusingArray_SetMaxIndex.

Elementscanbemanipulatedindividuallyorasagroup,inallorpartofanarray.

Usage

Array:<IntraBarPersist>ArrayName1[D1,D2,D3,etc.](InitialValue1<,DataN>),<IntraBarPersist>ArrayName2[D1,D2,D3,etc.](InitialValue2<,DataN>),etc.

Parametersinsidetheangledbracketsareoptional

Parameters

IntraBarPersist-anoptionalparameter;specifiesthatthevalueofthearrayelementsistobeupdatedoneverytickIfthisparameterisnotspecified,thevaluewillbeupdatedatthecloseofeachbar.

ArrayName-anexpressionspecifyingthearrayname

323

Page 324: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

D-anumericalexpressionspecifyingthearraysizeinelements,startingat0,foreachofthedimensions;asingleexpressionspecifiesaone-dimensionalarray,twoexpressionsspecifyatwo-dimensional(D1byD2)array,threeexpressionsspecifyathree-dimensional(D1byD2byD3)array,etc.Adynamicarray,withanunlimitednumberofelements,isspecifiedbytheemptysquarebrackets:[]andwillbeaone-dimensionalarray.

InitialValue-anexpression,specifyingtheinitialvalueanddefiningthedatatypeforalloftheelementsinthearrayThevaluecanbeanumerical,string,ortrue/falseexpression;thetypeoftheexpressiondefinesthedatatype.

DataN-anoptionalparameter;specifiestheDataNumberofthedataseriesthearrayistobetiedtoIfthisparameterisnotspecified,thearraywillbetiedtothedefaultdataseries.

Example

DeclareLengthandSFactoras9-elementone-dimensionalnumericalarrayswithdataelements'initialvaluesof0:

Array:Length[8](0),SFactor[8](0);

DeclareMax_Priceasa24-elementby60-elementtwo-dimensionalnumericalarray,updatedoneverytick,tiedtotheserieswithData#2,andwithdataelements'initialvaluesequaltothevalueofClosefunction:

Array:IntraBarPersistMax_Price[23,59](Close,Data2);

DeclareHighs2asadynamicnumericalarraywithdataelements'initialvaluesof0:

Array:Highs2[](0);

324

Page 325: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ArraysSameastheArray

325

Page 326: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InputDeclaresoneormorenamesasinputs;specifiesthedefaultvalueanddefinestheinputtypeforeachinput.

Inputscanbenumerical,string,ortrue/false.Oncedeclared,thevalueoftheinputcannotbemodifiedbythestudy'scode.

Usage

Input:InputName1(DefaultValue1),InputName2(DefaultValue2),etc.

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

DefaultValue-anexpressionspecifyingthedefaultvalueanddefiningtheinputtype

Theexpressioncanbenumerical,string,ortrue/false;thetypeoftheexpressiondefinestheinputtype.

Example

DeclareLengthasanumericalinputwiththedefaultvalueof20:

Input:Length(20);

DeclarePriceasanumericalinputwiththedefaultvalueequaltothevalueofClosefunction,andNameasacharacterstringinputwiththedefaultvalueof"LastClose":

Input:Price(Close),Name("LastClose");

DeclareDraw_Lineasatrue/falseinputwiththedefaultvalueofTrue:

326

Page 327: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Input:Draw_Line(True);

327

Page 328: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InputsSameastheInput

328

Page 329: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntraBarPersistUsedinvariableandarraydeclarationstatements,beforeavariableorarrayname,tospecifythatthevalueofthevariableorarrayelementsaretobeupdatedoneverytick.

IfIntraBarPersistisnotspecified,thevaluewillbeupdatedatthecloseofeachbar.

Usage

Declaration:[IntraBarPersist]Name(InitialValue1)

Example

DeclareMaxasanumericalvariable,updatedoneverytick,withtheinitialvalueof100:

Variable:IntraBarPersistMax(100);

DeclareMax_Priceasa24-elementsingle-dimensionnumericalarray,updatedoneverytick,andwithdataelements'initialvaluesof0:

Array:IntraBarPersistMax_Price[23](0);

329

Page 330: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericUsedinfunctioninputdeclarationstatementstodefineaninputasNumerical.

InputdefinedasNumericalcanbeusedbothasaNumericalSimpleaswellasaNumericalSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName(Numeric)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareLengthasaNumericalfunctioninput:

Input:Length(Numeric);

330

Page 331: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericArrayUsedinfunctioninputdeclarationstatementstodefineaninputasaNumericalArraywithaspecifiednumberofdimensions.

InputdefinedasNumericalcanbeusedbothasaNumericalSimpleaswellasaNumericalSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName[M1,M2,M3,etc.](NumericArray)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareLengthasaone-dimensionalNumericalArrayfunctioninput:

Input:Length[X](NumericArray);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

331

Page 332: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DeclareTableasathree-dimensionalNumericalArrayfunctioninput:

Input:Table[X,Y,Z](NumericArray);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

332

Page 333: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericArrayRefUsedinfunctioninputdeclarationstatementstodefineaninputasPassedbyReferenceNumericalArraywithaspecifiednumberofdimensions.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName[M1,M2,M3,etc.](NumericArrayRef)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareCountasaPassedbyReferenceone-dimensionalNumericalArrayfunctioninput:

Input:Count[X](NumericArrayRef);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

DeclareTableasaPassedbyReferencethree-dimensionalNumericalArray

333

Page 334: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

functioninput:

Input:Table[X,Y,Z](NumericArrayRef);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

334

Page 335: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericRefUsedinfunctioninputdeclarationstatementstodeclareaPassedbyReferenceNumericalinput.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName(NumericRef)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareBarCountasaPassedbyReferenceNumericalfunctioninput:

Input:BarCount(NumericRef);

335

Page 336: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericSeriesUsedinfunctioninputdeclarationstatementstodefineaninputasaNumericalSeries.

ThevalueofaninputdefinedasaSeriesmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName(NumericSeries)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclarePriceasaNumericalSeriesfunctioninput:

Input:Price(NumericSeries);

336

Page 337: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumericSimpleUsedinfunctioninputdeclarationstatementstodefineaninputasNumericalSimple.

ThevalueofaninputdefinedasSimpleisconstantfrombartobarandthushasnohistory.

Usage

Input:InputName(NumericSimple)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareLengthasaNumericalSimplefunctioninput:

Input:Length(NumericSimple);

337

Page 338: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RecalcPersistUsedinvariabledeclarationstatements,beforeavariablename,tospecifythatthevalueofthevariableistobeupdatedoneverytickandthelatestvalueofthisvariableistobesavedafterthestudyrecalculation.

Usage

Declaration:[RecalcPersist]Name(InitialValue1)

Note

Thiskeywordcanbeusedonlywithvariables.Thevariablewithsuchanattributecannotbeserialtype.

Example

DeclareMaxasanumericalvalue,updatedoneverytick,withinitialvalueof100.

Afterstudyrecalculation,thelatestvalueofMaxwillbesaved:

Variable:RecalcPersistMax(100);

338

Page 339: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringUsedinfunctioninputdeclarationstatementstodefineaninputasString.

InputdefinedasStringcanbeusedbothasaStringSimpleaswellasaStringSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName(String)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareNameasaStringfunctioninput:

Input:Name(String);

339

Page 340: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringArrayUsedinfunctioninputdeclarationstatementstodefineaninputasaStringArraywithaspecifiednumberofdimensions.

InputdefinedasStringcanbeusedbothasaStringSimpleaswellasaStringSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName[M1,M2,M3,etc.](StringArray)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareMessagesasaone-dimensionalStringArrayfunctioninput:

Input:Messages[X](StringArray);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

DeclareMessageTableasathree-dimensionalStringArrayfunctioninput:

340

Page 341: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Input:MessageTable[X,Y,Z](StringArray);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

341

Page 342: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringArrayRefUsedinfunctioninputdeclarationstatementstodefineaninputasPassedbyReferenceStringArraywithaspecifiednumberofdimensions.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName[M1,M2,M3,etc.](StringArrayRef)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareMessagesasaPassedbyReferenceone-dimensionalStringArrayfunctioninput:

Input:Messages[X](StringArrayRef);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

DeclareCommentsTableasaPassedbyReferencethree-dimensionalStringArray

342

Page 343: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

functioninput:

Input:CommentsTable[X,Y,Z](StringArrayRef);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

343

Page 344: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringRefUsedinfunctioninputdeclarationstatementstodeclareaPassedbyReferenceStringinput.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName(StringRef)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareMessageasaPassedbyReferenceStringfunctioninput:

Input:Message(StringRef);

344

Page 345: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringSeriesUsedinfunctioninputdeclarationstatementstodefineaninputasStringSeries.

ThevalueofaninputdefinedasaSeriesmayvaryfrombartobarandcanbereferredtohistorically.

Usage

Input:InputName(StringSeries)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareMessagesasaStringSeriesfunctioninput:

Input:Messages(StringSeries);

345

Page 346: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StringSimpleUsedinfunctioninputdeclarationstatementstodefineaninputasStringSimple.

ThevalueofaninputdefinedasSimpleisconstantfrombartobarandthushasnohistory.

Usage

Input:InputName(StringSimple)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareNameasaStringSimplefunctioninput:

Input:Name(StringSimple);

346

Page 347: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseUsedinfunctioninputdeclarationstatementstodefineaninputastrue/false.

Inputdefinedastrue/falsecanbeusedbothasatrue/falseSimpleaswellasatrue/falseSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName(TrueFalse)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareOvernightasatrue/falsefunctioninput:

Input:Overnight(TrueFalse);

347

Page 348: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseArrayUsedinfunctioninputdeclarationstatementstodefineaninputasatrue/falseArraywithaspecifiednumberofdimensions.

Inputdefinedastrue/falsecanbeusedbothasatrue/falseSimpleaswellasatrue/falseSeriesinput;thevalueofaSimpleinputisconstantfrombartobarandthushasnohistory,whilethevalueofaSeriesinputmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName[M1,M2,M3,etc.](TrueFalseArray)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareUpTrendasaone-dimensionaltrue/falseArrayfunctioninput:

Input:UpTrend[X](TrueFalseArray);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

348

Page 349: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DeclareFlagTableasathree-dimensionaltrue/falseArrayfunctioninput:

Input:FlagTable[X,Y,Z](TrueFalseArray);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

349

Page 350: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseArrayRefUsedinfunctioninputdeclarationstatementstodefineaninputasPassedbyReferencetrue/falseArraywithaspecifiednumberofdimensions.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName[M1,M2,M3,etc.](TrueFalseArrayRef)

Parameters

InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

M-aninputvariablethatrepresentsthemaximumindexvalueforeachdimensionofthearraypassedtothefunction;asingleinputvariablespecifiesaone-dimensionalarrayinput,twoinputvariablesspecifyatwo-dimensional(M1byM2)arrayinput,threeinputvariablesspecifyathree-dimensional(M1byM2byM3)arrayinput,etc.

Aninputwillonlyacceptanarraywiththespecifiednumberofdimensions.

Example

DeclareTrendasaPassedbyReferenceone-dimensionaltrue/falseArrayfunctioninput:

Input:Trend[X](TrueFalseArrayRef);

ThemaximumindexvalueforthearraypassedtothefunctionwillbeassignedtoinputvariableX.

DeclareTrendTableasaPassedbyReferencethree-dimensionaltrue/falseArray

350

Page 351: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

functioninput:

Input:TrendTable[X,Y,Z](TrueFalseArrayRef);

ThemaximumindexvalueforeachdimensionofthearraypassedtothefunctionwillbeassignedtoinputvariablesX,Y,andZ.

351

Page 352: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseRefUsedinfunctioninputdeclarationstatementstodeclareaPassedbyReferencetrue/falseinput.

DeclaringaninputasPassedbyReferenceenablesthefunctiontomodifythevaluesofvariablespassedastheinput.

Usage

Input:InputName(TrueFalseRef)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareFlagasaPassedbyReferencetrue/falsefunctioninput:

Input:Flag(TrueFalseRef);

352

Page 353: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseSeriesUsedinfunctioninputdeclarationstatementstodefineaninputasatrue/falseSeries.

ThevalueofaninputdefinedasaSeriesmayvaryfrombartobarandcanbereferencedhistorically.

Usage

Input:InputName(TrueFalseSeries)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareUpTrendasatrue/falseSeriesfunctioninput:

Input:UpTrend(TrueFalseSeries);

353

Page 354: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TrueFalseSimpleUsedinfunctioninputdeclarationstatementstodefineaninputastrue/falseSimple.

ThevalueofaninputdefinedasSimpleisconstantfrombartobarandthushasnohistory.

Usage

Input:InputName(TrueFalseSimple)

Where:InputName-anexpressionspecifyingtheinputname

Thenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

Example

DeclareOvernightasatrue/falseSimplefunctioninput:

Input:Overnight(TrueFalseSimple);

354

Page 355: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VarSameastheVariable

355

Page 356: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VariableDeclaresoneormorenamesasvariables;specifiestheinitialvalue,variabletype,updatebasis,anddatanumberforeachvariable.

Variablescanbenumerical,string,ortrue/false.

Usage

Variable:[IntraBarPersist]VariableName1(InitialValue1[,DataN]),[IntraBarPersist]VariableName2(InitialValue2[,DataN]),etc.

Parametersinsidethesquarebracketsareoptional

Parameters

IntraBarPersist-anoptionalparameter;specifiesthatthevalueofthevariableistobeupdatedoneverytickIfthisparameterisnotspecified,thevaluewillbeupdatedatthecloseofeachbar.

VariableName-anexpression,specifyingthevariablenameThenamecanconsistofletters,underscorecharacters,numbers,andperiods.

Thenamecannotbeginwithanumberoraperiodandisnotcase-sensitive.

InitialValue-anexpression,specifyingtheinitialvalueanddefiningthevariabletypeThevaluecanbeanumerical,string,ortrue/falseexpression;thetypeoftheexpressiondefinesthevariabletype.

DataN-anoptionalparameter;specifiestheDataNumberofthedataseriesthevariableistobetiedtoIfthisparameterisnotspecified,thevariablewillbetiedtothedefaultdataseries.

Example

DeclareAvg.asanumericalvariablewiththeinitialvalueof20:

Variable:Avg.(20);

356

Page 357: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DeclareMaxasanumericalvariable,updatedoneverytick,withtheinitialvalueof100:

Variable:IntraBarPersistMax(100);

DeclareMin_Priceasanumericalvariable,tiedtotheserieswithData#2,andtheinitialvalueequaltothevalueofClosefunction:

Variable:Min_Price(Close,Data2);

DeclareOvernightasatrue/falsevariablewiththeinitialvalueofFalse,andNameasastringvariablewiththeinitialvalueof"Intra-Day":

Variable:Overnight(False),Name("Intra-Day");

357

Page 358: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VariablesSameastheVariable

358

Page 359: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VarsSameastheVariable

359

Page 360: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ArraySizeSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

360

Page 361: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ArrayStartAddrSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

361

Page 362: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BoolSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

362

Page 363: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ByteSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

363

Page 364: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CharSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

364

Page 365: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DefineDLLFuncSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

365

Page 366: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DoubleSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

366

Page 367: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DWORDSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

367

Page 368: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExternalSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

368

Page 369: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FloatSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

369

Page 370: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

iEasyLanguageObjectSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

370

Page 371: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

371

Page 372: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Int64Theint64isareservedworddefiningthatthepassedorreturnedvalueoffunctionsexportedfromthedllhasthelonglongtype(64-bitrepresentationofaninteger).

Note

DuetoarchitecturalspecificsofPowerLanguage,beforepassingthelonglongtypevalueinadll(orwhenthevalueswerereturnedfromadll)itisconvertedfromthe"double"type(orinto"double"type).Notethatprecisionofthedoubletypevaluesis15decimals.(Valuesrangeofthelonglongtypeisfrom-9,223,372,036,854,775,808to9,223,372,036,854,775,807-19decimalpoints).Itmeansthatwithoutlossofaccuracythevalueswiththerangefrom-999,999,999,999,999to999,999,999,999,999willbepassed.

Example

Definesthedllfunction,whichreceiveslonglongparameter:

DEFINEDLLFUNC:"test_int64.dll",void,"int64test_1",int64;

Definesthedllfunction,whichreturnslonglongvalue:

DEFINEDLLFUNC:"test_int64.dll",int64,"int64test_2";

372

Page 373: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LongSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

373

Page 374: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPBoolSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

374

Page 375: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPByteSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

375

Page 376: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPDoubleSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

376

Page 377: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPDWORDSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

377

Page 378: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPFloatSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

378

Page 379: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPIntSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

379

Page 380: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPLongSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

380

Page 381: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPSTRSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

381

Page 382: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LPWORDSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

382

Page 383: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MethodSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

383

Page 384: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OnCreateSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

384

Page 385: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OnDestroySupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

385

Page 386: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SelfSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

386

Page 387: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ThreadSafeDeclaresthefunctionimportedfromDLLasthread-safe.

ItwillincreasetheperformanceofcalculationandoptimizationofthestudiesthatuseexternalDLLs.

Usage

ThreadSafe

Notes

ItisnotrecommendedtoapplyThreadSafeattributetothefunctionsexportedfromelkit32.dll(forexampleFindAddress_).

Example

DEFINEDLLFUNC:ThreadSafe,"user32.dll",Void,"MessageBeep",Int;

WilldeclareMessageBeepfunctionofuser32.dllasthread-safe.

387

Page 388: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

UnsignedSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

388

Page 389: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VarSizeSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

389

Page 390: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VarStartAddrSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

390

Page 391: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

VoidSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

391

Page 392: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

WORDSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

392

Page 393: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

#EventsSupportedbyPowerLanguage.

AdetaileddescriptionandusageexampleshavebeenpublishedbyTradeStationTechnologies:EasyLanguageExtensionSDK

393

Page 394: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_AskPriceReturnsaskpriceforthecertaindepthlevelofaparticularsymbol.

Usage

DOM_AskPrice(num)[Data(N)]

where:

(num)-isthenumberofdepthlevel

(N)-isthenumberofthedataseries

Example

DOM_AskPrice(4);willreturntheaskpriceforthe5thlevelofdepthfortheData1

DOM_AskPrice(2)Data2;willreturntheaskpriceforthe3rdlevelofdepthfortheData2

394

Page 395: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_AsksCountReturnsthenumberofaskdepthlevelsavailableforaparticularsymbol.

Usage

DOM_AsksCount[Data(N)]

where:

(N)-isthenumberofthedataseries

Example

DOM_AsksCountwillreturn10if10asklevelsofthemarketdepthareavailablefortheData1

DOM_AsksCountData2willreturn6if6asklevelsofthemarketdepthareavailablefortheData2

395

Page 396: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_AskSizeReturnstheasksizeforthecertaindepthlevelofaparticularsymbol.

Usage

DOM_AskSize(num)[Data(N)]

where:

(num)-isthenumberofdepthlevel

(N)-isthenumberofthedataseries

Example

DOM_AskSize(2)willreturn1500iftheasksizeforthe3rdlevelofdepthonData1is1500

DOM_AskSize(0)Data2willreturn750iftheasksizeforthe1stlevelofdepthonData2is750

396

Page 397: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_BidPriceReturnsbidpriceforthecertaindepthlevelofaparticularsymbol.

Usage

DOM_BidPrice(num)[Data(N)]

where:

(num)-isthenumberofdepthlevel

(N)-isthenumberofthedataseries

Example

DOM_BidPrice(4);willreturnthebidpriceforthe5thlevelofdepthfortheData1

DOM_BidPrice(2)Data2;willreturnthebidpriceforthe3rdlevelofdepthfortheData2

397

Page 398: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_BidsCountReturnsthenumberofbiddepthlevelsavailableforaparticularsymbol.

Usage

DOM_BidsCount[Data(N)]

where:

(N)-isthenumberofthedataseries

Example

DOM_BidsCountwillreturn10if10bidlevelsofthemarketdepthareavailablefortheData1

DOM_BidsCountData2willreturn6if6bidlevelsofthemarketdepthareavailablefortheData2

398

Page 399: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_BidSizeReturnsthebidsizeforthecertaindepthlevelofaparticularsymbol.

Usage

DOM_BidSize(num)[Data(N)]

where:

(num)-isthenumberofdepthlevel

(N)-isthenumberofthedataseries

Example

DOM_BidSize(2)willreturn1500ifthebidsizeforthe3rdlevelofdepthonData1is1500

DOM_BidSize(0)Data2willreturn750ifthebidsizeforthe1stlevelofdepthonData2is750

399

Page 400: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DOM_IsConnectedReturnsalogicalvalueindicatingtheavailabilityofthemarketdepthdata;returnsavalueofTrueifthemarketdepthdataisavailableandavalueofFalseifthemarketdepthdataisnotavailable.

Usage

DOM_IsConnected

Example

Printtheasksizeforthe1stlevelofmarketdepthifthemarketdepthdataisavailable

Variables:

var0(0);

IfDOM_IsConnectedthen

var0=DOM_AskPrice(0);

Print(var0);

400

Page 401: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_CompareComparesaspecifiedrangeofelementsofthespecifiedone-dimensionalsourcearray,startingatthespecifiedsourceindex,tothesamerangeofelementsofthespecifiedone-dimensionaldestinationarray,startingatthespecifieddestinationindex.

Sourceanddestinationcanbethesamearrayaswellastwodifferentarrays.

Fornumericalarrays,thenumericalvaluesforeachpairofelementsarecompared.Forstringarrays,theASCIIvaluesofthestringcharacters,withthefirstcharacterofthestringbeingthemostsignificant,arecomparedforeachpairofelements.Fortrue/falsearrays,thelogicalvaluesofeachpairofelementsarecompared,withthevalueoftrueconsideredtobegreaterthanthevalueoffalse.

Returnsavalueof0ifeachrespectivepairofelementscomparedasequal;avalueof1if,forthefirstpairthatwasnotequal,thevalueinthesourcerangewasgreaterthenthevalueinthedestinationrange;andavalueof-1if,forthefirstpairthatwasnotequal,thevalueinthesourcerangewaslessthenthevalueinthedestinationrange.

Usage

Array_Compare(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements

Where:SourceArray-anexpressionspecifyingthenameofthesourcearrayDestinationArray-anexpressionspecifyingthenameofthedestinationarraySourceIndex-anumericalexpressionspecifyingthestartingindexforthesourcearrayDestinationIndex-anumericalexpressionspecifyingthestartingindexforthedestinationarrayNumberOfElements-anumericalexpressionspecifyingthenumberofelementstocompare

Return

0-eachrespectivepairofelementscomparedasequal1-forthefirstpaircomparedthatwasnotequal,thevalueinthesourcerangewasgreaterthenthevalueinthedestinationrange-1-forthefirstpaircomparedthatwasnotequal,thevalueinthesourcerangewaslessthenthevalueinthedestinationrange

401

Page 402: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

Assignavalue,indicatingtheresultofcomparingtwo-elementsegments,ofArray1,beginningattheindexof4,andofArray2,beginningattheindexof6,toValue1variable:

Value1=Array_Compare(Array1,4,Array2,6,2);

Assignavalue,indicatingtheresultofcomparingtwo-elementsegmentsthatbeginattheindexof4andattheindexof6withinthesamearray,toValue1variable:

Value1=Array_Compare(Array1,4,Array1,6,2);

402

Page 403: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_ContainsWillreturnTrue/Falsevaluedependingonwhetherspecificelementiscontainedintheone-dimensionalarray,ornot.

Usage

Array_Contains(ArrayName,Value)

Where:ArrayName-anexpressionspecifyingthenameofannumerical/string/boolarray.Value-anumerical/string/boolexpressionspecifyingthevaluetosearch.

Example

Assignatrue/falsevalue,indicatingthatvalue4iscontainedinthenumericarrayArray1,toCondition1variable:

Condition1=Array_Contains(Array1,4);

403

Page 404: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_CopyCopiesaspecifiednumberofelementsfromthespecifiedone-dimensionalsourcearray,startingatthespecifiedsourceindex;theelementsarecopiedtothespecifiedone-dimensionaldestinationarray,startingatthespecifieddestinationindex.

Sourceanddestinationcanbethesamearrayaswellastwodifferentarrays.

Usage

Array_Copy(SourceArray,SourceIndex,DestinationArray,DestinationIndex,NumberOfElements

Where:SourceArray-anexpressionspecifyingthenameofthesourcearrayDestinationArray-anexpressionspecifyingthenameofthedestinationarraySourceIndex-anumericalexpressionspecifyingthestartingindexforthesourcearrayDestinationIndex-anumericalexpressionspecifyingthestartingindexforthedestinationarrayNumberOfElements-anumericalexpressionspecifyingthenumberofelementstocopy

Example

CopyfromArray1thetwo-elementsegmentbeginningattheindexof4,totheArray2,beginningattheindexof6:

Array_Copy(Array1,4,Array2,6,2);

CopyfromArray1thetwo-elementsegmentbeginningattheindexof4,tothesamearray,beginningattheindexof6:

Array_Copy(Array1,4,Array1,6,2);

404

Page 405: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetBooleanValue

ReturnstheBooleanvaluewithacertainindexfromnumericalarray.

Usage

Array_GetBooleanValue

Example

AssignthesecondBooleanvalueofthe"arr"arraytoValue1variable:

Array:arr[10](0);Value1=Array_GetBooleanValue(arr,2);

405

Page 406: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetFloatValue

Returnsthefloatvaluewithacertainindexfromnumericalarray.

Usage

Array_GetFloatValue

Example

AssignthesecondfloatvalueofarrarraytoValue1variable:

Array:arr[10](0);Value1=Array_GetFloatValue(arr,2);

406

Page 407: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetIntegerValue

Returnstheintegervaluewithacertainindexfromnumericalarray.

Usage

Array_GetIntegerValue

Example

Assignthesecondfloatvalueof"arr"arraytoValue1variable:

Array:arr[10](0);Value1=Array_GetIntegerValue(arr,2);

407

Page 408: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetMaxIndexReturnsanumericalvalueindicatingthemaximumindexofaone-dimensionalarray.

Arrayindexesstartat0,andarraysizeisequaltothevalueofthemaximumindexplusone.

Usage

Array_GetMaxIndex(ArrayName)

Where:ArrayName-anexpressionspecifyingthenameofanarray

Example

AssignavaluethatindicatesthemaximumindexofArray1totheMaxIndexvariable:

MaxIndex=Array_GetMaxIndex(Array1);

408

Page 409: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetStringValue

Returnsthestringvaluewithacertainindexfromnumericalarray.

Usage

Array_GetStringValue

Example

Assignthesecondfloatvalueof"arr"arraytoValue1variable:

Array:arr[10](0);Value1=Array_GetStringValue(arr,2);

409

Page 410: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_GetTypeReturnsanumericalvalueindicatingthetypeofthespecifiedarray.

Usage

Array_GetType(ArrayName)

Where:ArrayName-anexpressionspecifyingthenameofanarray

Return

2-atrue/falsearray3-astringarray7-adouble-precisionnumericalarray

Example

Assignavalue,indicatingthetypeofArray1,toValue1variable:

Value1=Array_GetType(Array1);

410

Page 411: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_IndexOfWillreturnindexofaspecificelementinone-dimensionalarray.Willreturn-1ifthearraywillnotcontainthespecificelement.

Usage

Array_IndexOf(ArrayName,Value)

Where:ArrayName-anexpressionspecifyingthenameofannumerical/string/boolarray.Value-anumerical/string/boolexpressionspecifyingthevaluetosearchfor.

Example

Assignanindexofvalue4toValue1variableinthenumericarrayArray1:

Value1=Array_IndexOf(Array1,4);

411

Page 412: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetBooleanValue

SetstheBooleanvalueforacertainindexofnumericalarray.

Usage

Array_SetBooleanValue

Example

Setthefirstandthirdvaluesof"arr"arraytoTRUE:

Array:arr[10](False);Array_SetBooleanValue(arr,1,True);Array_SetBooleanValue(arr,1,True);

412

Page 413: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetFloatValue

Setsthefloatvalueforacertainindexofnumericalarray.

Usage

Array_SetFloatValue

Example

Setthefirstandthirdvaluesof"arr"arrayto1.789:

Array:arr[10](False);Array_SetFloatValue(arr,1,1.789000352);Array_SetFloatValue(arr,3,1.789000352);

413

Page 414: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetIntegerValue

Setstheintegervalueforacertainindexofnumericalarray.

Usage

Array_SetIntegerValue

Example

Setthefirstandthirdvaluesof"arr"arrayto500:

Array:arr[10](False);Array_SetIntegerValue(arr,1,500);Array_SetIntegerValue(arr,3,500);

414

Page 415: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetMaxIndexResizesadeclareddynamicarraytoaspecifiednumberofelements;returnsavalueofTruetoindicateasuccessfulresize.

Anarraycanberesizedtoalargerortoasmallernumberofelements;anyelementsaddedtoanarraywillbeassignedtheinitialvaluethatwasspecifiedatarraydeclaration.

Usage

Array_SetMaxIndex(ArrayName,MaxIndex)

Where:ArrayName-anexpressionspecifyingthenameofanarraytoberesizedMaxIndex-anumericalexpressionspecifyingthemaximumindexofthearray*

*Arrayindexesstartat0,andarraysizeisequaltothevalueofMaxIndexplusone.

Return

True-resizesucessfull

False-resizefailed

Example

ResizethedynamicarrayArray1to10elementsbyspecifyingamaximumindexvalueof9:

Array_SetMaxIndex(Array1,9);

AssignavaluethatindicatesastatusoftheresizeofArray1totheResizeReportvariable:

ResizeReport=Array_SetMaxIndex(Array1,9);

AvalueofTruewillindicateasuccessfulresize,andavalueofFalsewillindicateafailedresize.

415

Page 416: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

416

Page 417: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetStringValue

Setsthestringvalueforacertainindexofnumericalarray.

Usage

Array_SetStringValue

Example

Setthefirstandthirdvaluesof"arr"arrayto"arraystring":

Array:arr[10](False);Array_SetStringValue(arr,1,"arraystring");Array_SetStringValue(arr,3,"arraystring");

417

Page 418: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SetValRangeAssignsaspecifiedvaluetoeachelementwithinaspecifiedrange,ofthespecifiedone-dimensionalarray.

Usage

Array_SetValRange(ArrayName,StartIndex,EndIndex,Value)

Where:ArrayName-anexpressionspecifyingthenameofanarrayStartIndex-anumericalexpressionspecifyingthestartingindexfortherangeEndIndex-anumericalexpressionspecifyingtheendingindexfortherangeValue-avaluetobeassignedtoeachelementwithintherange

Example

AssignavalueofTruetoeachelementwithinasegment,beginningatindex4andendingatindex6,ofArray1:

Array_SetValRange(Array1,4,6,True);

418

Page 419: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SortSorts,ineitherascendingordescendingorder,therangeofelements,specifiedbythestartingandendingindexes,ofthespecifiedone-dimensionalarray.

Fornumericalarrays,theelementsaresortedaccordingtothevaluestheycontain.Forstringarrays,theelementsaresortedaccordingtotheASCIIvaluesofthestringcharacters,withthefirstcharacterofthestringbeingthemostsignificant.Forsortingtrue/falsearrayelements,thevalueoftrueisconsideredtobegreaterthanthevalueoffalse.

Usage

Array_Sort(ArrayName,StartIndex,EndIndex,SortOrder)

Where:ArrayName-anexpressionspecifyingthenameofanarrayStartIndex-anumericalexpressionspecifyingthestartingindexfortherangeEndIndex-anumericalexpressionspecifyingtheendingindexfortherangeSortOrder-atrue/falsevaluespecifyingthesortorder;truespecifiesascendingorder,andfalsespecifiesdescendingorder

Example

SorttheelementsinthesegmentofArray1thatbeginsattheindexof4andendsattheindexof6,inascendingorder:

Array_Sort(Array1,4,6,True);

419

Page 420: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Array_SumReturnsasumofthevaluescontainedinarangeofelements,specifiedbythestartingandendingindexes,ofthespecifiedone-dimensionalarray;returnsthenumberoftrueelementsifthearraycontainstrue/falsevalues;returnsavalueof0ifthearraycontainsstringvalues.

Usage

Array_Sum(ArrayName,StartIndex,EndIndex)

Where:ArrayName-anexpressionspecifyingthenameofanarrayStartIndex-anumericalexpressionspecifyingthestartingindexfortherangeEndIndex-anumericalexpressionspecifyingtheendingindexfortherange

Example

Assignavalue,indicatingasumofthevaluescontainedinthesegmentofArray1thatbeginsattheindexof4andendsattheindexof6,toValue1variable:

Value1=Array_Sum(Array1,4,6);

420

Page 421: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Fill_Array

Assignsaspecifiedvaluetoeachelementofthespecifiedone-dimensionalarray.

Usage

Fill_Array(ArrayName,Value)

Where:ArrayName-anexpressionspecifyingthenameofanarrayValue-avaluetobeassignedtoeachelementofthearray

Example

AssignavalueofTruetoeachelementofArray1:

Fill_Array(Array1,True);

421

Page 422: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BaseDataNumber

ReturnsanumericalvalueindicatingtheDataNumberoftheseriesthatthestudyisappliedto.

Usage

BaseDataNumber

Example

Assignavalue,indicatingtheDataNumberoftheseriesthatthestudyisappliedto,toValue1variable:

Value1=BaseDataNumber;

422

Page 423: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentDataNumber

ReturnsanumericalvalueindicatingtheDataNumberoftheseriesthatthefunctionisbeingcalculatedon.

Usage

CurrentDataNumber

Example

Assignavalue,indicatingtheDataNumberoftheseriesthatthefunctionisbeingcalculatedon,toValue1variable:

Value1=CurrentDataNumber;

423

Page 424: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExecOffset

Returnsanumericalvalueindicatingthefunctionexecutionoffsetinbars.

Usage

ExecOffset

Example

Assignavalue,indicatingthefunctionexecutionoffset,toValue1variable:

Value1=ExecOffset;

424

Page 425: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetAppInfoReturnsanumericalvalue,representingthespecifiedattributeofthecallingapplication.

Usage

GetAppInfo(Attribute)

Parameters

aiApplicationType-identifiesthecallingapplication:

0=Unknown

1=Chart

2=Scanner

aiBarSpacing-specifiesreturnofthenumberofspacesbetweenthebarsonachartGetAppInfowillreturnavalue,indicatingthebarspacingofachart.

aiCalcReason-returnsanumericalvalue,indicatingthereasonofcalculationinitialization(i.e.returns0(CalcReason_Default)whencalculationwastriggeredbyanewbar/tick):

0(CalcReason_default)-calculationistobeinitializedwhenthenewbar/tickappeared.

1(CalcReason_mouseLClick)calculationistobeinitializedafterleft-clickonthechart.

2(CalcReason_mouseRClick)-calculationistobeinitializedafterright-clickonthechart.

3(CalcReason_timer)calculationistobeinitializedafterexpirationofRecalcLastBarAftertimeout.

4(CalcReason_MPChange)calculationistobeinitializedaftermarketpositionfortheinstrumenthasbeenchanged(forsignalsonly).

425

Page 426: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

5(CalcReason_OrderFilled)calculationistobeinitializedafterorderfilledevent(forsignalsonly).

aiHighestDispValue-specifiesreturnofthehighestpricevaluethatcouldbedisplayedinthecurrentchartwindowGetAppInfowillreturnthehighestpricevaluethatcouldbedisplayedonachart.

aiLowestDispValue-specifiesreturnofthelowestpricevaluethatcouldbedisplayedinthecurrentchartwindowGetAppInfowillreturnthelowestpricevaluethatcouldbedisplayedonachart.

aiLeftDispDateTime-specifiesreturnofthedateandtimeoftheleftmostbardisplayedinthecurrentchartwindowGetAppInfowillreturntheDateTimevalueoftheleftmostbardisplayedonachart;theintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

aiRightDispDateTime-specifiesreturnofthedateandtimeoftherightmostbardisplayedinthecurrentchartwindowGetAppInfowillreturntheDateTimevalueoftherightmostbardisplayedonachart;theintegerportionoftheDateTimevaluespecifiesthenumberofdayssinceJanuary1st,1900,andthefractionalportionoftheDateTimevaluespecifiesthefractionofthedaysincemidnight.

aiRow-identifiesthesymbol'srownumberinScanner;returnsapositivenon-zerovaluefromaScannerapplicationelsereturns0.

aiSpaceToRight-specifiesreturnoftherightmargin,inbars,ofthecurrentchartwindowGetAppInfowillreturntherightmargin,inbars,ofachart.

aiOptimizing-specifiesreturnofanumericalvalue,indicatingwhetherthecallingapplicationiscurrentlyperforminganoptimizationGetAppInfowillreturnavalueof1onlyifthecallingapplicationiscurrentlyperforminganoptimization,andavalueof0inallothercases.

aiStrategyAuto-specifiesreturnofanumericalvalue,indicatingwhetherthecallingapplicationisusingAutomatedTradeExecutionGetAppInfowillreturnavalueof1onlyifthecallingapplicationisusingAutomatedTradeExecution,andavalueof0inallothercases.

aiStrategyAutoConf-specifiesreturnofanumericalvalue,indicatingwhetherthecallingapplicationisusingAutomatedTradeExecutionwithorderconfirmationturnedoffGetAppInfowillreturnavalueof0onlyifthecalling

426

Page 427: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

applicationisusingAutomatedTradeExecutionwithorderconfirmationturnedoff,andavalueof1inallothercases.

aiIntrabarOrder-specifiesreturnofanumericalvalue,indicatingwhetherthecallingapplicationisrunningthesignalwithintra-barordergenerationturnedonGetAppInfowillreturnavalueof1onlyifthecallingapplicationisrunningthesignalwithintra-barordergenerationturnedon,andavalueof0inallothercases.

aiAppId-specifiesreturnofanumericalvalue,usedtoidentifythecallingapplicationGetAppInfowillreturnauniquenon-zerointegeridentifyingthecallingapplication.

aiRealTimeCalc-specifiesreturnofanumericalvalue,indicatingwhetherthecallingapplicationscalculationsarebasedonreal-timedataGetAppInfowillreturnavalueof1onlyifthecallingapplication'scalculationsarebasedonreal-timedata,andavalueof0inallothercases.

aichartshiftpercent-returnstheChartShiftvalueinpercentsfromFormatWindow->X-TimeScale.Thevalueisupdatedonthefly.

Example

GetAppInfo(aiBarSpacing)willreturnavalue,indicatingthebarspacingofachart

GetAppInfo(aiStrategyAutoConf)willreturnavalueof0ifthecallingapplicationisusingAutomatedTradeExecutionwithorderconfirmationturnedoff;otherwise,willreturnavalueof1

GetAppInfo(aiRealTimeCalc)willreturnavalueof1ifthecallingapplicationscalculationsarebasedonreal-timedata;otherwise,willreturnavalueof0

[ProcessMouseEvents=true];switch(getappinfo(aicalcreason))begincaseCalcReason_MouseLClick:ifMouseClickCtrlPressedthenbeginvar:var0(0),var1(0);repeatif0=var0thenbeginvar0=MouseClickDateTime;break;end;

427

Page 428: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

until(false);end;end;var1=datetime2eltime(var0);print("TimeoftheBar=",var1);

WillreturnthetimeofthebarafterleftclickonitpressingCtrlbuttononthekeyboard.

428

Page 429: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetCDRomDrive

ReturnsastringexpressionofthedriveletterforthefirstCD-ROMdrivedetected.

Usage

GetCDRomDrive

Example

Variables:Drive("D");Drive=GetCDRomDrive;

WillsetthevariableDriveequaltothefirstCD-ROMdrivedetected.

429

Page 430: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetCountryReturnsthelocalename,correspondingtotheStandardsandformatssettingselectedintheRegionalOptionssettingsoftheWindowsXPControlPanel.

Usage

GetCountry

Example

GetCountrywillreturnastringexpression"UnitedStates"forthesetting"English(UnitedStates)"

430

Page 431: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetCurrencyReturnsthecurrencysymbolselectedintheRegionalOptionssettingsoftheWindowsXPControlPanel.

Usage

GetCurrency

Example

GetCurrencywillreturnthe"$"symbolfortheUSDollar

431

Page 432: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetUserID

Returnsauniqueidentificationnumber(UserID)forthePCthatthestudyisbeingrunon.

UserIDnumberisusedforstudyprotection.

Usage

GetUserID

Example

Assignavalue,indicatingtheUserID,toValue1variable:

Value1=GetUserID;

432

Page 433: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetUserNameReturnsMultiChartsregistrationname(UserName)forMultiChartsinstallationonthePCthatthestudyisbeingrunon.

UserNameisusedforstudyprotection.

Usage

GetUserName

Example

Assignavalue,indicatingtheUserName,toUserNamevariable:

Var:UserName("");

UserName=GetUserName;

433

Page 434: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxBarsBack

ReturnsanumericalvalueindicatingtheMaximumBarsBacksettingforthestudy.

Allstudiesbasedonpastdatauseacertainnumberofbarsfortheircalculations.ThenumberofbarsiscalledMaximumnumberofbarsastudywillreference,orMaximumBarsBack.

Usage

MaxBarsBack

Example

Assignavalue,indicatingtheMaximumBarsBacksettingforthestudy,toValue1variable:

Value1=MaxBarsBack;

434

Page 435: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxBarsForward

Returnsanumericalvalueindicatingthesize,inbars,oftherightmarginonthechart.

Rightmarginisusedbythestudiesthatvisualizethepredictedpricemovement.

Usage

MaxBarsForward

Example

Assignavalue,indicatingthesizeoftherightmarginofthechart,toValue1variable:

Value1=MaxBarsForward;

435

Page 436: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetMaxBarsBack

SetsanumericalvalueindicatingtheMaximumBarsBacksettingforthestudy.

Allstudiesbasedonpastdatauseacertainnumberofbarsfortheircalculations.

ThenumberofbarsiscalledMaximumnumberofbarsastudywillreference,orMaximumBarsBack.

Usage

SetMaxBarsBack(BarsBack)

Where:BarsBack-numericalexpression,specifyingthenumberofbarsback

Note

BarsBackcan'tbeanegativevalue.

Example

Setavalue,indicatingtheMaximumBarsBacksettingforthestudyto50:

SetMaxBarsBack(50);

436

Page 437: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Abort

Generatesarun-timeerrorandabortstheexecutionofthestudy.

Usage

Abort

Example

Abortthestudysexecution:

Abort;

437

Page 438: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CommandLine

Passesastringexpressionfromscripttocommandline.

Usage

CommandLine("Expression")

Seethelistofsupportedexpressionsforthecommandline.

Examples

CommandLine(".rld");

Reloadsthechartwherethescriptisapplied(reloadsallchartwherethesamesymbolisused).

CommandLine(".at_toggle");

Turnson/offautotradingonthechartwherethescriptisapplied(ifitisusedtoturnautotradingon,thepoppedupconfirmationwindowcannotbeskippedandamanualclickon"OK"isrequired).

CommandLine(".csydnum=1,name=AUD/CHF,df=LMAX");

Changesthesymbolplottedasdataseries1toAUD/CHFandthedatasourcetoLMAXonthechartwherethescriptisapplied.

CommandLine(".isyname=@ES#,df=IQFeed,res=1min,desc=E-MINIS&P;500MARCH2013,from=12/31/2012,to=5/10/2013");

Inserts1minutegraphofS&P;mini500fromIQFeedstartingfrom31thofDecember2012upto10thofMay2013asadditionaldataseriestothechartwherethescriptisapplied.

CommandLine(".iidname=MACD,base=1,bref=100");

AppliesMACDindicatortothedataseries1withMaxBarsBackparameter=100to

438

Page 439: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

thechartwherethescriptisapplied.

CommandLine(".rldint2weeks");

Reloads2weeksofdataonthechartwherethescriptisapplied.

439

Page 440: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcExactAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof0.00;canbesubstitutedbyanumericalvalueof5.

Usage

SetFPCompareAccuracy(fpcExactAccuracy)

or:

SetFPCompareAccuracy(5)

Example

SetthefloatingpointcompareaccuracytoExact:

SetFPCompareAccuracy(fpcExactAccuracy);

SetthefloatingpointcompareaccuracytoExact:

SetFPCompareAccuracy(5);

440

Page 441: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcHighAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof2.2204460492503131e-14;canbesubstitutedbyanumericalvalueof3.

Usage

SetFPCompareAccuracy(fpcHighAccuracy)

or:

SetFPCompareAccuracy(3)

Example

SetthefloatingpointcompareaccuracytoHigh:

SetFPCompareAccuracy(fpcHighAccuracy);

SetthefloatingpointcompareaccuracytoHigh:

SetFPCompareAccuracy(3);

441

Page 442: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcLowAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof2.2204460492503131e-10;canbesubstitutedbyanumericalvalueof1.

Usage

SetFPCompareAccuracy(fpcLowAccuracy)

or:

SetFPCompareAccuracy(1)

Example

SetthefloatingpointcompareaccuracytoLow:

SetFPCompareAccuracy(fpcLowAccuracy);

SetthefloatingpointcompareaccuracytoLow:

SetFPCompareAccuracy(1);

442

Page 443: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcMedAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof2.2204460492503131e-12;canbesubstitutedbyanumericalvalueof2.

Usage

SetFPCompareAccuracy(fpcMedAccuracy)

or:

SetFPCompareAccuracy(2)

Example

SetthefloatingpointcompareaccuracytoMedium:

SetFPCompareAccuracy(fpcMedAccuracy);

SetthefloatingpointcompareaccuracytoMedium:

SetFPCompareAccuracy(2);

443

Page 444: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcVeryHighAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof2.2204460492503131e-16;canbesubstitutedbyanumericalvalueof4.

Usage

SetFPCompareAccuracy(fpcVeryHighAccuracy)

or:

SetFPCompareAccuracy(4)

Example

SetthefloatingpointcompareaccuracytoVeryHigh:

SetFPCompareAccuracy(fpcVeryHighAccuracy);

SetthefloatingpointcompareaccuracytoVeryHigh:

SetFPCompareAccuracy(4);

444

Page 445: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

fpcVeryLowAccuracy

Constant,usedincombinationwithSetFPCompareAccuracytodesignatethefloatingpointcomparetolerancevalueof2.2204460492503131e-8;canbesubstitutedbyanumericalvalueof0.

Usage

SetFPCompareAccuracy(fpcVeryLowAccuracy)

or:

SetFPCompareAccuracy(0)

Example

SetthefloatingpointcompareaccuracytoVeryLow:

SetFPCompareAccuracy(fpcVeryLowAccuracy);

SetthefloatingpointcompareaccuracytoVeryLow:

SetFPCompareAccuracy(0);

445

Page 446: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RaiseRunTimeError

Generatesarun-timeerroranddisplaysthespecifiederrormessage.

Arun-timeerrorwillcausetheexecutionofthestudytobeaborted.

Usage

RaiseRunTimeError("Message")

Where:Message-astringexpressionspecifyingtheerrormessage

Example

Generatearun-timeerroranddisplaythemessage"StrategyStopped":

RaiseRunTimeError("StrategyStopped");

446

Page 447: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RecalcLastBarAfter

Initializesthecalculationafterexpirationofthetimeout,setinseconds.Note:Themaximumrecalculationfrequencyis100milliseconds(0.1sec).

RecalcLastBarAfter(Timeout)

Where:Timeout-thenumberofseconds.

Example

RecalcLastBarAfter(60)willinitiatenewscriptcalculationafteroneminutetimeoutsincethelastcalculation.

447

Page 448: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ReCalculate

Initializesrecalculationofthestudy.Allthevariableswillbere-initialized.

Thestudywillberecalculatedfromthefirstbarofthedataseries.

Usage

ReCalculate

Note

Toavoidinfiniteloopingofthescript,useglobalvariableswithrecalculationconditions.

Example

Settheconditionforrecalculation:

Var:ReCalcPersistrecalc_once(True),vo10(0);

IfLastBarOnChartThenBeginPrint("Lastbarvolume=",Volume);

Ifrecalc_onceThenBeginPrint("Recalculatestudy!");recalc_once=FalseReCalculate;End;

End;

448

Page 449: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetFPCompareAccuracy

Setsfloatingpointcompareaccuracybyspecifyingthetolerancevaluetobeusedwhenfloatingpointvaluesarecompared.

Twofloatingpointvalueswillbeconsideredequalif"abs(Value1Value2)<=ε",whereεisthetolerancevalue.

Bydefault,thetolerancevalueis2.2204460492503131e-012.

Usage

SetFPCompareAccuracy(Accuracy)

Parameters

Accuracy-anFPCconstantoranumericalexpressionspecifyingatolerancevalueasfollows:

fpcVeryLowAccuracy 0 02.2204460492503131e-8fpcLowAccuracy 1 12.2204460492503131e-10fpcMedAccuracy 2 22.2204460492503131e-12(Default)fpcHighAccuracy 3 32.2204460492503131e-14fpcVeryHighAccuracy 4 42.2204460492503131e-16fpcExact 5 50.00

Example

SetfloatingpointcompareaccuracytoHigh:

SetFPCompareAccuracy(3);

SetfloatingpointcompareaccuracytoHigh:

SetFPCompareAccuracy(fpcHighAccuracy);

449

Page 450: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

#Return

ReturnsthecontrolfromthestudyscriptbyanalogywiththecorrespondingC++statement.

Doesnotreturnanyvalue.

Usage

#Return;

Notes

Canbeusedinalltypesofstudies.

450

Page 451: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AtCommentaryBarThisreservedwordreturnsavalueofTrueonthebarclickedbytheuser.

ItwillreturnavalueofFalseforallotherbars.

Thisallowsyoutooptimizeyourtradingstrategies,analysistechniques,andfunctionsforspeed,asitwillallowPowerLanguagetoskipallcommentary-relatedcalculationsforallbarsexceptfortheonewherethecommentaryisrequested.

Usage

AtCommentaryBar

Notes

ThedifferencebetweenAtCommentaryBarandCommentaryEnabledisthatCommentaryEnabledreturnsavalueofTrueforALLbarswhentheExpertCommentarywindowisopen,whiletheAtCommentaryBarreturnsavalueofTrueonlyforthebarclicked.

Example

Thefollowingstatementsdisplaya50-baraverageofthevolumeintheExpertCommentarywindowbutavoidcalculatingthis50-baraverageforeveryotherbarofthechart:

IfAtCommentaryBarThen

Commentary("The50-barvolavg:",Average(Volume,50));

451

Page 452: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CheckCommentaryReturnsTrueafterleftclickonachartwiththeExpertCommentarypointeronthespecifiedbar.

ReturnsFalseifthepointerhasnotbeeninserted,orifthepointerwasinsertedonadifferentbar.

Usage

CheckCommentary

Example

IfyouonlywantedcodetobeevaluatedforthebarwheretheuserhadinsertedtheExpertCommentaryTool,youcouldusethefollowingsyntax:

IfCheckCommentaryThenBegin{YourCodeHere}End;

452

Page 453: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CommentaryThisreservedwordsendstheexpression(orlistofexpressions)totheExpertCommentarywindowforwhateverbarisselectedonthepricechart.

Usage

Commentary("MyExpression");

Where"MyExpression"isthenumerical,textstringortrue/falseexpressionthatistobesenttotheExpertCommentarywindow.

Youcansendmultipleexpressions,commasmustseparatethem.

Example

Thefollowingwillresultinthestring"Thisisonelineofcommentary"beingsenttothecommentarywindow.

Anyadditionalcommentarysentwillbeplacedonthesameline.

Commentary("Thisisonelineofcommentary");

453

Page 454: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CommentaryCLThisreservedwordsendstheexpression(orlistofexpressions)totheExpertCommentarywindowforwhateverbarisselectedbytheExpertCommentarypointer.

Usage

CommentaryCL("MyExpression");

Where"MyExpression"isasingleoracomma-separatedlistofnumeric,textstring,ortrue/falseexpressionsthataresenttotheExpertCommentarywindow.

Example

Thefollowingwillresultinthestring"Thisisonelineofcommentary"beingsenttothecommentarywindow.

Anyadditionalcommentarysentwillbeplacedonthenextline.

CommentaryCL("Thisisonelineofcommentary");

454

Page 455: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CommentaryEnabledThisreservedwordreturnsavalueofTrueonlywhentheExpertCommentarywindowisopenandCommentaryhasbeenrequested.

Thisallowsyoutooptimizeyourtradingstrategies,analysistechniques,andfunctionsforspeed,asitallowsPowerLanguagetoperformcommentary-relatedcalculationsonlywhentheExpertCommentarywindowisopen.

Usage

CommentaryEnabled

Notes

ThedifferencebetweenCommentaryEnabledandAtCommentaryBaristhatCommentaryEnabledreturnsavalueofTrueforALLbarswhentheExpertCommentarywindowisopen,whiletheAtCommentaryBarreturnsavalueofTrueonlyforthebarclickedwiththeExpertCommentarypointer.

Example

CommentaryEnabledwillreturnTrueiftheAnalysisCommentaryToolhasbeenappliedtothechart.

455

Page 456: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

#BeginCmtryThestatementsbetweenthiscompilerdirectiveandthereservedword#EndareevaluatedonlywhentheExpertCommentarytoolisusedtoselectabaronachartoracellinagrid.

Thereservedword#Endmustbeusedwiththisreservedword.

Usage

#BeginCmtry

Commentary("Theindicatorvaluehereis"+NumtoStr(Plot1,2));

#End;

Notes

Allstatementsbetweenthe#BeginCmtryand#Endareignored,includingcalculationofMaxBarsBack,unlesscommentaryisgenerated.

Example

Anindicatorthatcalculatesthe10-barmomentumoftheclosingpriceneedstenbarsinordertostartplottingresults.

Ifcommentaryisaddedtothisindicatorandthecommentaryusesa50-baraverageofthevolume,thentheMaxBarsBacksettingisincreasedtofifty.

However,the50-baraverageisonlyusedforthecommentary,sothereisnoneedtohavetheindicatorwaitfiftybarsbeforegivingresultsunlessCommentaryisrequested.

Tohavetheindicatorplotafter10barsandignorethe50-barrequirement,theindicatorcanbewrittenasfollows:

Plot1(Close-Close[10],"Momentum");

456

Page 457: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

#BeginCmtry;IfClose-Close[10]>0ThenCommentary("Momentumispositive,")ElseCommentary("Momentumisnegative,");IfVolume>Average(Volume,50)ThenCommentary("andvolumeisgreaterthanaverage.")ElseCommentary("andvolumeislowerthanaverage.");#End;

Thisindicatorplotsthemomentumandthecommentarystateswhetherthemomentumispositiveornegative,andifthevolumeisoverorunderthe50-baraverageofthevolume.

Whentheindicatorisappliedwithoutusingcommentary,itwillrequireonly10barstostartcalculating.

Whencommentaryisrequested,theindicatorisrecalculated,thestatementswithinthecompilerdirectivesareevaluated,andthenewminimumnumberofbarsrequiredis50.

Anyseriesfunctionswithinthesereservedwordsarealsoignored.

457

Page 458: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AbsValueReturnstheabsolutevalueofthespecifiednumericalexpression.

Usage

AbsValue(Value)

Where:Value-anumericalexpression

Example

AbsValue(45.275)willreturnavalueof45.275

AbsValue(-1385)willreturnavalueof1385

458

Page 459: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ArcTangentReturnsthearctangentvalue,indegrees,ofthespecifiednumericalexpression.

Usage

ArcTangent(Value)

Where:Value-anumericalexpression

Example

ArcTangent(2.318)willreturnavalueof66.66

459

Page 460: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgListReturnstheaveragevalueofthespecifiednumericalexpressions.

Usage

AvgList(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

AvgList(45,40,0,35)willreturnavalueof30

AvgList(-40,20)willreturnavalueof-10

460

Page 461: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CeilingReturnsthesmallestintegergreaterthanorequaltothespecifiednumericalexpression.

Usage

Ceiling(Value)

Where:Value-anumericalexpression

Example

Ceiling(9.1)willreturnavalueof10

Ceiling(-2.85)willreturnavalueof-2

461

Page 462: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CosineReturnsthecosinevalueforanangleofthespecifiednumberofdegrees.

Usage

Cosine(Value)

Where:Value-anumericalexpression,specifyingthenumberofdegreesintheangle

Example

Cosine(60)willreturnavalueof0.5

462

Page 463: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CotangentReturnsthecotangentvalueforanangleofthespecifiednumberofdegrees.

Usage

Cotangent(Value)

Where:Value-anumericalexpression,specifyingthenumberofdegreesintheangle

Example

Cotangent(30)willreturnavalueof1.732

463

Page 464: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExpValueReturnstheexponentialvalueofthespecifiednumericalexpression.

Usage

ExpValue(Value)

Where:Value-anumericalexpression

Example

ExpValue(2.3)willreturnavalueof9.0250

464

Page 465: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FloorReturnsthegreatestintegerlessthanorequaltothespecifiednumericalexpression.

Usage

Floor(Value)

Where:Value-anumericalexpression

Example

Floor(9.1)willreturnavalueof9

Floor(-2.85)willreturnavalueof-3

465

Page 466: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FracPortionReturnsthefractionalportionofthespecifiednumericalexpressionwhileretaingthesign.

Usage

FracPortion(Value)

Where:Value-anumericalexpression

Example

FracPortion(-45.275)willreturnavalueof-0.275

FracPortion(1385)willreturnavalueof0

466

Page 467: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IntPortionReturnstheintegerportionofthespecifiednumericalexpressionwhileretaingthesign.

Usage

IntPortion(Value)

Where:Value-anumericalexpression

Example

IntPortion(-45.75)willreturnavalueof-45

IntPortion(1385)willreturnavalueof1385

467

Page 468: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LogReturnsthenaturallogarithmofthespecifiednumericalexpression.

Usage

Log(Value)

Where:Value-anumericalexpression

Example

Log(25)willreturnavalueof3.2189

468

Page 469: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxListReturnsthevalueofthegreatestofthespecifiednumericalexpressions.

Usage

MaxList(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

MaxList(-5,0,12,7)willreturnavalueof12

469

Page 470: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxList2Returnsthesecondhighestvalueofthespecifiednumericalexpressions.

Usage

MaxList2(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

MaxList2(-5,0,12,7)willreturnavalueof7

470

Page 471: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MinListReturnsthelowestvalueofthespecifiednumericalexpressions.

Usage

MinList(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

MinList(-5,0,12,7)willreturnavalueof-5

471

Page 472: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MinList2Returnsthesecondlowestvalueofthespecifiednumericalexpressions.

Usage

MinList2(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

MinList(-5,0,12,7)willreturnavalueof0

472

Page 473: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ModReturnstheremainderfromdividingonespecifiednumericalexpressionbyanother.

Usage

Mod(Dividend,Divisor)

Where:Dividend-anumericalexpressionDivisor-anumericalexpression

Example

Mod(25,7)willreturnavalueof4

473

Page 474: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NegReturnsthenegativeabsolutevalueofthespecifiednumericalexpression.

Usage

Neg(Value)

Where:Value-anumericalexpression

Example

Neg(12)willreturnavalueof-12

Neg(-7)willreturnavalueof-7

474

Page 475: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NthMaxListReturnstheNthhighestvalueofthespecifiednumericalexpressions.

Usage

NthMaxList(N,Value1,Value2,Value3,etc.)

Where:N-anumericalexpression,indicatingtherankofthevaluetobereturnedValue1,Value2,Value3,etc.-numericalexpressions

Example

NthMaxList(4,-15,-5,0,6,12)willreturnavalueof-5

475

Page 476: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NthMinListReturnstheNthlowestvalueofthespecifiednumericalexpressions.

Usage

NthMinList(N,Value1,Value2,Value3,etc.)

Where:N-anumericalexpression,indicatingtherankofthevaluetobereturnedValue1,Value2,Value3,etc.-numericalexpressions

Example

NthMinList(4,-15,-5,0,6,12)willreturnavalueof6

476

Page 477: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosSameasAbsValue

477

Page 478: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PowerReturnsthevalueofonespecifiednumericalexpressiontothepowerofanother.

Usage

Power(Base,Exponent)

Where:Base-anumericalexpressionExponent-anumericalexpression

Example

Power(5,3)willreturnavalueof125

478

Page 479: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RandomReturnsapseudo-randomnumberbetween0andthevalueofthespecifiednumericalexpression.

Usage

Random(Value)

Where:Value-anumericalexpression

Example

Random(1.25)willreturnarandomvalueanywherebetween0and1.25

Random(-10)willreturnarandomvalueanywherebetween-10and0

479

Page 480: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RoundReturnsthevalueofonespecifiednumericalexpressionroundedtothenumberofdecimalplacesspecifiedbyanother.

Usage

Round(Value,Precision)

Where:Value-anumericalexpressionPrecision-anumericalexpression

Example

Round(1.237,2)willreturnavalueof1.24

Round(-5.7744,3)willreturnavalueof5.774

480

Page 481: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SignReturnsanumericalvalue,indicatingthesignofthevalueofthespecifiednumericalexpression.

Avalueof1isreturnedforapositivevalue,-1isreturnedforanegativevalue,and0isreturnedforthevalueof0.

Usage

Sign(Value)

Where:Value-anumericalexpression

Example

Sign(5)willreturnavalueof1

Sign(-2.85)willreturnavalueof-1

Sign(0)willreturnavalueof0

481

Page 482: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SineReturnsthesinevalueforanangleofthespecifiednumberofdegrees.

Usage

Sine(Value)

Where:Value-anumericalexpression,specifyingthenumberofdegreesintheangle

Example

Sine(30)willreturnavalueof0.5

482

Page 483: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SquareReturnsthesquareofthevalueofthespecifiednumericalexpression.

Usage

Square(Value)

Where:Value-anumericalexpression

Example

Square(2.5)willreturnavalueof6.25

483

Page 484: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SquareRootReturnsthesquarerootofthevalueofthespecifiednumericalexpression.

Usage

SquareRoot(Value)

Where:Value-anumericalexpression

Example

SquareRoot(57.73)willreturnavalueof7.598

484

Page 485: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SumListReturnsasumofthevaluesofthespecifiednumericalexpressions.

Usage

SumList(Value1,Value2,Value3,etc.)

Where:Value1,Value2,Value3,etc.-numericalexpressions

Example

SumList(45,-20,0,35)willreturnavalueof60

485

Page 486: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TangentReturnsthetangentvalueforanangleofthespecifiednumberofdegrees.

Usage

Tangent(Value)

Where:Value-anumericalexpression,specifyingthenumberofdegreesintheangle

Example

Tangent(40)willreturnavalueof0.839

486

Page 487: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AgoUsedincombinationwithBarorBarsandanumericalexpressiontoreferencethebaraspecifiednumberofbarsbackfromthecurrentbar.

BarsAgocanalsobespecifiedbyusingthebaroffsetnotationthatconsistsofanumericalexpressionenclosedinsquarebrackets.

Usage

NBarsAgo

or:

[N]

Where:N-anumericalexpressionspecifyingthenumberofbarsbacktoreference

Example

Plottheclosingpriceofthepreviousbar:

Plot1(CloseOf1BarAgo,"Previousbar'sclose");

Plottheclosingpriceoftwobarsago:

Plot1(Close[2],"Close2barsago");

487

Page 488: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarUsedincombinationwithThis,Next,orAgotoreferenceaspecificbar.

Usage

Bar

Example

CloseOf1BarAgowillreturntheclosingpriceofthepreviousbar

Buyauser-setnumberofsharesoncloseofthisbar:

BuyThisBarOnClose;

Buyauser-setnumberofsharesonopenofnextbar:

BuyNextBarOnOpen;

488

Page 489: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSameasBar

489

Page 490: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ContractSameasContracts

490

Page 491: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ContractsUsedinstrategyentryorexitstatementsincombinationwithanumericalexpressiontospecifythenumberofcontractsorsharestotrade.

Usage

TradeSizeContracts

Where:TradeSize-anumericalexpression,specifyingthenumberofcontractsorshares

Example

Buy2contractsatMarketpriceonopenofnextbar:

Buy2ContractsNextBarAtMarket;

491

Page 492: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketUsedinstrategyentryorexitstatementstospecifyaMarketpriceforanentryoranexit.

AMarketBuyorderwillexecuteatthecurrentaskpriceandaMaretSellorderwillexecuteatthecurrentbidprice.

Usage

AtMarket

Where:Atisaskipwordandcanbeomitted

Example

Buyauser-setnumberofsharesatMarketpriceonopenofnextbar:

BuyNextBarAtMarket;

492

Page 493: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NextUsedincombinationwithBartoreferencethenextbar.

Usage

NextBar

Example

Buyauser-setnumberofsharesatMarketpriceonopenofnextbar:

BuyNextBarAtMarket;

493

Page 494: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ThisUsedincombinationwithBartoreferencethecurrentbar.

Usage

ThisBar

Example

Buyauser-setnumberofsharesoncloseofthisbar:

BuyThisBarOnClose;

494

Page 495: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TodayRetainedforbackwardcompatibility;replacedwithThisBar

495

Page 496: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

YesterdayRetainedforbackwardcompatibility.

496

Page 497: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickBarNumber

Afteramouseclickonthebar,returnsthenumericalvalueindicatingthebarnumberfromthebeginningofthedataseries.

Usage

MouseClickBarNumber

Example

MouseClickBarNumber-willreturn250afteramouseclickonthe250thbaronthechartfromthebeginningofthedataseries.

497

Page 498: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickCtrlPressed

ReturnsTrueiftheCtrlbuttonispressedonthekeyboardsimultaneouslywithamouseclick.

Usage

MouseClickCtrlPressed

498

Page 499: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickDataNumber

Returnsthenumericalvalueindicatingthedataseriesnumberafteramouseclickonthedataseries.

Usage

MouseClickDataNumber

Example

MouseClickDataNumber-willreturn1afterleft-clickonthemainchartwiththemaindataseries.

MouseClickDataNumber-willreturn2afterleft-clickonthesub-chartwiththeseconddataseries.

499

Page 500: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickDateTime

Returnsadouble-precisiondecimalvalueinJulian(OLE)date-timeformatindicatingtheclosingdateofthebarafteraclickonthebar.

Usage

MouseClickDateTime

Example

MouseClickDateTime-willreturnavalueof39449.65625000for3:45PM.

500

Page 501: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickPrice

Returnsanumericalvalueindicatingpricelevelofthemousepointerpositionafteraclickonthechart.

Usage

MouseClickPrice

Example

MouseClickPrice-willreturn139.60afteraclickonthechartonthe139.60pricelevel.

501

Page 502: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MouseClickShiftPressed

ReturnsTrueiftheShiftbuttonispressedonthekeyboardsimultaneouslywithamouseclick.

Usage

MouseClickShiftPressed

502

Page 503: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlaySoundPlaysthespecifiedwave(.wav)soundfile.

Usage

PlaySound("PathFilename")

Where:PathFilename-astringexpressionspecifyingthepathandfilenameofthewavefiletobeplayed

Example

Playding.wavsoundfilelocatedintherootdirectoryoftheC:harddrive:

PlaySound("C:\ding.wav");

503

Page 504: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ClearDebugClearsthePowerLanguageEditorOutputLog.

Usage

ClearDebug

Example

ClearDebug;willclearthePowerLanguageEditorOutputLog

504

Page 505: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ClearPrintLogSameasClearDebug

505

Page 506: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FileUsedinPrintstatementstospecifyanASCIIfileastheoutputlocation;mustprecedetheexpressionstobeprintedandbefollowedbyacomma.Ifthespecifiedfiledoesnotexist,thefilewillbecreated.

Usage

File("PathFilename")

Where:PathFilename-astringexpressionspecifyingthepathandfilename

Example

Print(File("C:\test.txt"),CurrentDate,CurrentTime);willsavetheoutputofCurrentDateandCurrentTimetothetest.txtfileintherootdirectoryoftheC:harddrive

506

Page 507: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FileAppendAppendsthespecifiedstringexpressiontotheendofthespecifiedASCIIfile;ifthespecifiedfiledoesnotexist,thefilewillbecreated.

Usage

FileAppend("PathFilename","StringExpression")

Where:PathFilename-astringexpressionspecifyingthepathandfilenameStringExpression-thestringexpressiontobeappendedtoafile

Example

FileAppend("C:\test.txt","AppendedText");willappendthestringexpression"AppendedText"totheendofthetest.txtfileintherootdirectoryoftheC:harddrive

507

Page 508: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FileDeleteDeletesthespecifiedfile.

Usage

FileDelete("PathFilename")

Where:PathFilename-astringexpressionspecifyingthepathandfilenameofthefiletobedeleted

Example

FileDelete("C:\test.txt");willdeletethefiletest.txtintherootdirectoryoftheC:harddrive

508

Page 509: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MessageLogDisplaysoneormorespecifiedexpressionsinthePowerLanguageEditorOutputLog.Anycombinationofstring,true/false,numericalseries,ornumericalexpressionscanbespecified.

Usage

MessageLog(Expression1,Expression2,etc.)

Parameters

Expression-astring,true/false,numericalseries,ornumericalexpression;anynumberofvalidexpressions,separatedbycommas,canbeused

Astringexpressionmustbeenclosedinquotationmarks:

"StringExpression"

Anumericalexpressioncanbeformattedtospecifytheminimumnumberofcharacters,includingthedecimalpoint,andthenumberofdecimalplaces,tobeusedfortheoutput:

Expression:C:D

Where:C-minimumnumberofcharactersD-numberofdecimalplaces

Thedefaultoutputformatforanumericalexpressionistwodecimalplacesandaminimumofsevencharacters.

Ifthenumberofdecimalplacesinthenumericalexpressionismorethanthespecifiednumber,thevaluewillbewillberoundedofftothespecifiednumberofdecimalplaces.

Ifthenumberofcharactersintheoutputislessthanthespecifiedminimum,leadingspaceswillbeaddedtobringtheoutputtothespecifiedminimumvalue.

509

Page 510: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

MessageLog(.1);willdisplay0.10inthePowerLanguageEditorOutputLog,withthreeleadingspacesinserted

MessageLog(1.555555:6:3);willdisplay1.556inthePowerLanguageEditorOutputLog,withoneleadingspaceinserted

MessageLog("CurrentTimeis:",CurrentTime:5:0);willdisplaythestringexpression"CurrentTimeis:",followedbytheoutputoftheCurrentTime,withoneleadingspaceinserted,inthePowerLanguageEditorOutputLog

510

Page 511: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PrintSendsoneormorespecifiedexpressionstothePowerLanguageEditorOutputLogoranotheroutputtarget,ifspecified.Anycombinationofstring,true/false,numericalseries,ornumericalexpressionscanbespecified.

Usage

Print([OutputTarget],Expression1,Expression2,etc.)

ParameterinsidethesquarebracketsisoptionalParameters

OutputTarget-anoptionalparameter;specifiesanoutputtargetotherthenthePowerLanguageEditorOutputLog;theparametermustbefollowedbyacomma.

Therearetwooptionaloutputtargets:

Printer

Specifiesthedefaultprinterastheoutputtarget.

File("PathFilename")

Where:PathFilename-astringexpressionspecifyingthepathandfilename

SpecifiesanASCIIfileastheoutputtarget;ifthespecifiedfiledoesnotexist,thefilewillbecreated.

IfOutputTargetisnotspecified,theoutputwillbesenttothePowerLanguageEditorOutputLog.

Expression-astring,true/false,numericalseries,ornumericalexpression;anynumberofvalidexpressions,separatedbycommas,canbeused

Astringexpressionmustbeenclosedinquotationmarks:

"StringExpression"

511

Page 512: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Anumericalexpressioncanbeformattedtospecifytheminimumnumberofcharacters,includingthedecimalpoint,andthenumberofdecimalplaces,tobeusedfortheoutput:

Expression:C:D

Where:C-minimumnumberofcharactersD-numberofdecimalplaces

Thedefaultoutputformatforanumericalexpressionistwodecimalplacesandaminimumofsevencharacters.

Ifthenumberofdecimalplacesinthenumericalexpressionismorethanthespecifiednumber,thevaluewillbewillberoundedofftothespecifiednumberofdecimalplaces.

Ifthenumberofcharactersintheoutputislessthanthespecifiedminimum,leadingspaceswillbeaddedtobringtheoutputtothespecifiedminimumvalue.

Example

Print(.1);willprint0.10inthePowerLanguageEditorOutputLog,withthreeleadingspacesinserted

Print(1.555555:6:3);willprint1.556inthePowerLanguageEditorOutputLog,withoneleadingspaceinserted

Print(Printer,"PrintTest");willsendthestringexpression"PrintTest"tothedefaultprinter

Print(File("C:\test.txt"),CurrentDate,CurrentTime);willsavetheoutputofCurrentDateandCurrentTimetothetest.txtfileintherootdirectoryoftheC:harddrive

512

Page 513: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DefaultUsedinplotstatementstospecifyadefaultstyle.Defaultstylesaresetbytheuser.

FormoreinformationseePlot

Usage

Default

Example

Plottheclosingpriceusingthedefaultstyles(colorandwidth):

Plot1(Close,"Close",Default,Default,Default);

513

Page 514: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetBackgroundColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothebackgroundcolorofthechart.

Usage

GetBackgroundColor

Example

AssignanRGBcolornumber,correspondingtothebackgroundcolorofthechart,toValue1variable:

Value1=GetBackgroundColor;

Assignalegacycolorvalue,correspondingtothebackgroundcolorofthechart,toValue1variable:

[LegacyColorValue=True];

Value1=GetBackgroundColor;

514

Page 515: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPlotBGColor

Returnsthenumericcolorvalueoftheplot(cell)backgroundinagrid.

Usage

GetPlotBGColor(PlotNum)

Where:PlotNum-numericalexpressionrepresentingplotnumber

Example

Setavariable,Value1,tothecellcolorofthePlot1background:

Value1=GetPlotBGColor(1);

515

Page 516: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPlotColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothecolorofthespecifiedplot.

Usage

GetPlotColor(PlotNumber)

Where:PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999

Example

AssignanRGBcolornumber,correspondingtothecolorofPlot1,toValue1variable:

Value1=GetPlotColor(1);

Assignalegacycolorvalue,correspondingtothecolorofPlot1,toValue1variable:

[LegacyColorValue=True];

Value1=GetPlotColor(1);

516

Page 517: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetPlotWidth

Returnstheplotlinewidthvalueofthespecifiedplot.Plotlinewidthvaluesrangefrom0to14.

Usage

GetPlotWidth(PlotNumber)

Where:PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999

Example

AssigntheplotlinewidthvalueofPlot1toValue1variable:

Value1=GetPlotWidth(1);

517

Page 518: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

I_getplotvalue

Getsthevaluecalculatedbyasignalthatistobeusedforplottingfromanindicator.Itcanbeconsideredasabridgebetweenasignalandanindicator.Usingi_setplotvalueandi_getplotvaluekeywordsmakesitpossibletoavoidcopyingthesamescriptforcalculationthesamevalueinbothindicatorandsignal.

Usage

i_getplotvalue(index)

Parameters

index-isthereferencenumber

Notes

1. i_getplotvaluecanbeusedinfunctionsandindicatorsifanysignalisappliedtothemainchart.

2. Valueswillbetransferredbetweeni_setplotvalueandi_getplotvalueONLYwithin1chartwindow,

3. i_setplotvalueandi_getplotvaluewillreturn0ifappliedtotheMarketScannerWindow,

4. i_setplotvalueandi_getplotvaluecannotbeusedwhilebacktestingaportfolio,

5. i_setplotvalueandi_getplotvaluecannotbereferredhistorically,

6. itispossibletouseunlimitedindexesfordatatransfer.

Usage

Plotintheindicatorthemaxdrawdownandopenequityvaluescalculatedbythesignalwithindexes111and112

518

Page 519: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

plot1(i_getplotvalue(111),"MaxIDDrawdown");

plot2(i_getplotvalue(112),"OpenEquity");

519

Page 520: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

I_setplotvalue

Setsthevaluecalculatedbyasignalthatistobeusedforplottingfromanindicator.Itcanbeconsideredasabridgebetweenasignalandanindicator.Usingi_setplotvalueandi_getplotvaluekeywordsmakesitpossibletoavoidcopyingthesamescriptforcalculationthesamevalueinbothindicatorandsignal.

Usage

i_setplotvalue(index,value)

Parameters

index-isthereferencenumber

value-isthevaluethatistobetransferred.

Notes

1. i_setplotvaluecanbeusedinsignals,functionsand

indicatorsifanysignalisappliedtothemainchart.

2. Valueswillbetransferredbetweeni_setplotvalueandi_getplotvalueONLYwithin1chartwindow,

3. i_setplotvalueandi_getplotvaluewillreturn0ifappliedtotheMarketScannerWindow,

4. i_setplotvalueandi_getplotvaluecannotbeusedwhilebacktestingaportfolio,

5. i_setplotvalueandi_getplotvaluecannotbereferredhistorically,

6. itispossibletouseunlimitedindexesfordatatransfer.

Usage

520

Page 521: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Setthemaxdrawdownandopenequityvaluescalculatedbythesignaltobetransferredintotheindicatorwithindexes111and112

i_setplotvalue(111,maxiddrawdown)

i_setplotvalue(112,netprofit+openpositionprofit)

521

Page 522: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NoPlotRemovesaspecifiedplotfromthecurrentbar.

Aconditionalplotthatisalreadydrawnwillremaineveniftheconditionsbecomenolongertruebeforethebarisclosed.NoPlotcanbeusedtoremovetheconditionalplotfromthecurrentbariftheconditionsarenolongertrue.

Usage

NoPlot(PlotNumber)

Where:PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999

Example

TheexamplebelowusesNoPlotremovethePlotPaintBarplot"painted"overthechartsbarsforwhichtheHighpriceisnolongerlessthentheHighpriceofthepreviousbar:

IfHigh<High[1]ThenBeginPlotPaintBar(High,Low,"",Red);End

ElseBeginNoPlot(1);NoPlot(2);End;

WithoutNoPlot,chartsbarsforwhichaHighpricewasinitiallylessthentheHighpriceofthepreviousbarwouldremainpartiallypaintedevenifaHighpriceequaltoorgreaterthentheHighpriceofthepreviousbarwasreachedbeforethebarwasclosed.

522

Page 523: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotPlotsthespecifiednumericalorstringexpressiononachart,upto999differentplotscanbeusedsimultaneously.

Numerical:Plotoffset,name,color,andplotlinewidthcanbespecifiedbyusingtheoptionalparameters.

String:Abilitytoshowauser-definedtextmessageonthestatuslineofthechartorinthescanner.

Usage

Numerical:PlotN<[Offset]>(Expression<,"PlotName"<,PlotColor<,ScannerCellBackgroundColor<,LineWidth>>>>)

Text:PlotN("String")

Parametersinsidetheangledbracketsareoptional

Parameters

N-anumberusedtoidentifytheplot;plotnumberscanrangefrom1to999

Offset-anoptionalparameter;anumericalexpressionspecifyingtheplotoffset,inbars;apositivevaluewilldisplacetheplottotheleftalongthetimeaxis,andanegativevaluewilldisplacetheplottotherightalongthetimeaxis

Expression-thenumericalexpressiontobeplotted

PlotName-anoptionalparameter;assignsanametotheplot

PlotColor-anoptionalparameter;specifiestheplotcolorPlotcolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,byoneof17basecolorwords,orbythewordDefaulttospecifythecolorchosenbytheuser.InorderforPlotColortobeused,PlotNameparametermustalsobeused.

ScannerCellBackgroundColor-anoptionalparameter;setsthebackgroundcolorofthescannercellifthisplotisappliedtoascanner;usethewordDefault

523

Page 524: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

tospecifythecolorchosenbytheuser.InorderforScannerCellBackgroundColortobeused,PlotNameandPlotColorparametersmustalsobeused.

LineWidth-anoptionalparameter;specifiestheplotlinewidth,rangingfrom1to14PlotlinewidthcanbespecifiedasanumericalexpressionorbythewordDefaulttospecifythelinewidthchosenbytheuser.InorderforLineWidthtobeused,PlotName,PlotColor,andScannerCellBackgroundColorparametersmustalsobeused.

String-texttobedisplayed

Example

Plottheclosingpriceusingthedefaultplotcolorandlinewidth:

Plot1(Close);

Plottheclosingpriceusingthedefaultplotcolorandlinewidth,andnametheplot"Close":

Plot1(Close,"Close",Default,Default,Default);

Plottheclosingprice,offsetbackby3bars,usingtheplotcolorofblue,usingcellbackgroundcolorofgreenifthisplotisappliedtoascanner,linewidthof3,andnametheplot"Close3barslater":

Plot1[3](Close,"Close3barslater",Blue,Green,3);

Plottheclosingprice,offsetforwardby3bars,usingtheRGBcolor2138336(Orange),andnametheplot"Close3barsago":

Plot1[-3](Close,"Close3barsago",2138336);

Plottheclosingpriceusingthelegacycolorvalueof4(Green)andnametheplot"Close":

[LegacyColorValue=True];Plot1(Close,"Close",4);

Showthetext"Attention!"onthestatusbarofthechartorinthescanner.

524

Page 525: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Plot1("Attention!");

Showthetext"Attention!"onthestatusbarofthechartorinthescanneriftheclosepriceisgreaterthan100.Ifclose>100thenPlot1("Attention!");

525

Page 526: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotPaintBarPlotsthespecifiednumericalexpressionsintheformofabarchart.

Plotname,color,andplotlinewidthcanbespecifiedbyusingtheoptionalparameters.

PlotPaintBarplotcanbesuperimposedontopofoneormorebarsofabarchart,effectively"painting"thebars.

Usage

PlotPaintBar(BarHigh,BarLow,BarOpen,BarClose<,"PlotName"<,PlotColor<,Default<,LineWidth>>>>)

Parametersinsidetheangledbracketsareoptional

Parameters

BarHigh,BarLow,BarOpen,BarClose-numericalexpressionsspecifyingtheHigh,Low,Open,&Closepricesforthebarstobeplotted;atleasttwooftheseparametersarerequired

PlotName-anoptionalparameter;assignsanametotheplot

PlotColor-anoptionalparameter;specifiestheplotcolorPlotcolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,byoneof17basecolorwords,orbythewordDefaulttospecifythecolorchosenbytheuser.InorderforPlotColortobeused,PlotNameparametermustalsobeused.

Default-anoptionalparameterreservedforfutureuse;shouldbespecifiedasDefault;useofthisparameterisrequiredinorderforLineWidthtobeused

LineWidth-anoptionalparameter;specifiestheplotlinewidth,rangingfrom1to14PlotlinewidthcanbespecifiedasanumericalexpressionorbythewordDefaulttospecifythelinewidthchosenbytheuser.InorderforLineWidthtobeused,PlotName,PlotColor,andDefaultparametersmustalsobeused.

526

Page 527: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Notes

PlotPaintBar(BarHigh,BarLow,BarOpen,BarClose);

istheequivalentof:

Plot1(BarHigh);Plot2(BarLow);Plot3(BarOpen);Plot4(BarClose);

InorderforthePlotPaintBarplottobedisplayedintheformofabarchart,theplottypeforeachPlotmustbeset,intheStylesectionoftheGeneraltaboftheFormatIndicatorwindow,toBarHigh,BarLow,LeftTick,andRightTick,respectively.

Example

PaintredthesebarsofanOHLCchartforwhichtheOpenpriceislessthentheOpenpriceofthepreviousbar:

IfOpen<Open[1]ThenPlotPaintBar(High,Low,Open,Close,"",Red);

527

Page 528: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlotPBSameasthePlotPaintBar

528

Page 529: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetPlotBGColorAssignsaspecifiedcolortothecellbackgroundfortheindicatedstudyplotforthedurationofthecurrentbar.

UseofSetBGPlotColoriseffectiveonlyfortheScanner.

Usage

SetPlotBGColor(PlotNumber,PlotColor)

Parameters

PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999

PlotColor-anexpressionspecifyingthecellbackgroundcolorfortheindicatedplot.CellbackgroundcolorfortheindicatedplotcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumber,alegacycolorvalue,orbyoneof17basecolorwords.

Example

Assignthecolorofbluetotheindicatedcelloftheplot1forthedurationofthecurrentbar:

SetPlotBGColor(1,Blue);

AssignRGBcolor2138336(Orange)totheindicatedcelloftheplot1forthedurationofthecurrentbar:

SetPlotColor(1,2138336);

Assignlegacycolor4(Green)totheindicatedcelloftheplot1forthedurationofthecurrentbar:

[LegacyColorValue=True];SetPlotBGColor(1,4);

529

Page 530: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

530

Page 531: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetPlotColor

Assignsaspecifiedcolortothespecifiedplotforthedurationofthecurrentbar.

Usage

SetPlotColor(PlotNumber,PlotColor)

Parameters

PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999

PlotColor-anexpressionspecifyingtheplotcolor

PlotcolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Example

Assignthecolorofbluetoplot1forthedurationofthecurrentbar:

SetPlotColor(1,Blue);

AssignRGBcolor2138336(Orange)toplot1forthedurationofthecurrentbar:

SetPlotColor(1,2138336);

Assignlegacycolor4(Green)toplot1forthedurationofthecurrentbar:

[LegacyColorValue=True];SetPlotColor(1,4);

531

Page 532: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetPlotWidth

Assignsaspecifiedlinewidthtothespecifiedplotforthedurationofthecurrentbar.

Usage

SetPlotWidth(PlotNumber,LineWidth)

Where:PlotNumber-anumericalexpressionspecifyingtheplotnumber;plotnumbersrangefrom1to999LineWidth-anumericalexpressionspecifyingtheplotlinewidth;linewidthcanrangefrom1to14

Example

Assignaplotlinewidthof10toplot1forthedurationofthecurrentbar:

SetPlotWidth(1,10);

532

Page 533: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_get_strategy_named_numReturnsanumericalvalue,indicatingthevalueofVariableNameofthestrategywithStrategyIndexnumber.

Usage

pmms_get_strategy_named_num(StrategyIndex,VariableName)

Parameters

StrategyIndex-numericvariable.

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_get_strategy_named_num(0,"CustomVar")

533

Page 534: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_get_strategy_named_strReturnsastringvalue,indicatingthevalueofVariableNameofthestrategywithStrategyIndexnumber.

Usage

pmms_get_strategy_named_str(StrategyIndex,VariableName)

Parameters

StrategyIndex-numericvariable.

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_get_strategy_named_str(0,"CustomStr")

534

Page 535: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_set_strategy_named_numThisfunctionsetsthevalueofVariableNameofthestrategywithStrategyIndexnumber.

Usage

pmms_set_strategy_named_num(StrategyIndex,VariableName,VariableValue)

Parameters

StrategyIndex-numericvariable.

VariableName-stringvariable.

VariableValue-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_set_strategy_named_num(0,"CustomVar",5)

535

Page 536: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_set_strategy_named_strThisfunctionsetsthestringvalueofVariableNameofthestrategywithStrategyIndexnumber.

Usage

pmms_set_strategy_named_str(StrategyIndex,VariableName,VariableValue)

Parameters

StrategyIndex-numericvariable.

VariableName-stringvariable.

VariableValue-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_set_strategy_named_str(0,"CustomStr","buy")

536

Page 537: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_allow_entries_allThisfunctionallowsallthestrategiestoopenpositions.

Usage

pmms_strategies_allow_entries_all

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_allow_entries_all

537

Page 538: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_countReturnsanumericalvalue,indicatingthenumberoftradingstrategies(whichisequaltonumberofdownloadedinstrumentsthataretraded).

Usage

pmms_strategies_count

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_count

538

Page 539: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_deny_entries_allThisfunctiondeniesallthestrategiestoopenpositions(entryorderswillbeexcludedfromRAWorderscollection).

Usage

pmms_strategies_deny_entries_all

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_deny_entries_all

539

Page 540: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_get_by_symbol_nameReturnsanindexofthestrategybasedoninstrumentname(-1,iftheinstrumentisnotfound).Ifseveralstrategiesareappliedtothesameinstrument,thenthenumberofoneofthesestrategieswillbereturned.

Usage

pmms_strategies_get_by_symbol_name(SymbolName)

Parameters

SymbolName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmms_strategies_get_by_symbol_name("MSFT");

540

Page 541: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_in_long_countReturnsanumericalvalue,indicatingthenumberofstrategieswithopenlongposition.Acceptsoneparameter-aonedimensionaldynamicalarray.Thisarrayisfilledwiththeindexnumbersofthestrategiesthathaveanopenlongpositionatthemomentofthestrategycalculation.

Usage

pmms_strategies_in_long_count(indexesArray)

Parameters

indexesArray-arrayvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

var:positionsLong(0);

array:strategyIndexes[](0);

positionsLong=pmms_strategies_in_long_count(strategyIndexes);

541

Page 542: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_in_positions_countReturnsanumericalvalue,indicatingthenumberofstrategieswithopenposition.Acceptsoneparameter-aonedimensionaldynamicalarray.Thisarrayisfilledwiththeindexnumbersofthestrategiesthathaveanopenpositionatthemomentofthestrategycalculation.

Usage

pmms_strategies_in_positions_count(indexesArray)

Parameters

indexesArray-arrayvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

var:positions(0);

array:strategyIndexes[](0);

positions=pmms_strategies_in_positions_count(strategyIndexes);

542

Page 543: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_in_short_countReturnsanumericalvalue,indicatingthenumberofstrategieswithopenshortposition.Acceptsoneparameter-aonedimensionaldynamicalarray.Thisarrayisfilledwiththeindexnumbersofthestrategiesthathaveanopenshortpositionatthemomentofthestrategycalculation.

Usage

pmms_strategies_in_short_count(indexesArray)

Parameters

indexesArray-arrayvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

var:positionsShort(0);

array:strategyIndexes[](0);

positionsShort=pmms_strategies_in_short_count(strategyIndexes);

543

Page 544: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_pause_allThisfunctionpausesordersendingforallstrategiesoftheportfolio.

Usage

pmms_strategies_pause_all

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_pause_all

544

Page 545: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_resume_allThisfunctionresumesordersendingforallstrategiesoftheportfolio.

Usage

pmms_strategies_resume_all

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_resume_all

545

Page 546: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategies_set_status_for_allThisfunctionsetsatext(string)statusforallstrategiesoftheportfolio(statusisindicatedintheCustomTextcolumnofPortfolioReal-TimeWindow).

Usage

pmms_strategies_set_status_for_all(Status)

Parameters

Status-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategies_set_status_for_all("Calculating")

546

Page 547: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_entriesThisfunctionallowsentryordersforstrategywithStrategyIndexnumber.

Usage

pmms_strategy_allow_entries(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_allow_entries(0)

547

Page 548: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_exitsThisfunctionallowsexitordersforstrategywithStrategyIndexnumber.

Usage

pmms_strategy_allow_exits(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_allow_exits(0)

548

Page 549: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_exit_from_longThesameaspmms_strategy_allow_exits,butappliedforexitsfromlongentriesonly.

549

Page 550: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_exit_from_shortThesameaspmms_strategy_allow_exits,butappliedforexitsfromshortentriesonly.

550

Page 551: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_long_entriesThesameaspmms_strategy_allow_entries,butappliedforlongentriesonly.

551

Page 552: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_allow_short_entriesThesameaspmms_strategy_allow_entries,butappliedforshortentriesonly.

552

Page 553: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_close_positionThisfunctionclosespositionofthestrategywithIndexnumberwithmarketorder(ordersgeneratedbythestrategywillbedeletedfromRawOrderscollection).

Usage

pmms_strategy_close_position(Index)

Parameters

Index-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_close_position(0)

553

Page 554: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_currentcontractsReturnsanumericalvaluerepresentingnumberofcontractsofthepositionopenedbystrategywithStrategyIndexnumber.

Usage

pmms_strategy_currentcontracts(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmms_strategy_currentcontracts(0);

554

Page 555: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_entriesThisfunctiondeniesentryordersforstrategywithStrategyIndexnumber(entryorderswillbedeletedfromRawOrderscollection).

Usage

pmms_strategy_deny_entries(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_deny_entries(0)

555

Page 556: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_exitsThisfunctiondeniesexitordersforstrategywithStrategyIndexnumber(exitorderswillbedeletedfromRawOrderscollection).

Usage

pmms_strategy_deny_exits(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_deny_exits(0)

556

Page 557: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_exit_from_longThesameaspmms_strategy_deny_exits,butappliedforexitsfromlongentriesonly.

557

Page 558: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_exit_from_shortThesameaspmms_strategy_deny_exits,butappliedforexitsformshortentriesonly.

558

Page 559: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_long_entriesThesameaspmms_strategy_deny_entries,butappliedforlongentriesonly.

559

Page 560: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_deny_short_entriesThesameaspmms_strategy_deny_entries,butappliedforshortentriesonly.

560

Page 561: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_entrypriceReturnsanumericalvaluerepresentinganaverageentrypriceofthepositionopenedbythestrategywithStrategyIndexnumber.

Usage

pmms_strategy_entryprice(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmms_strategy_entryprice(0);

561

Page 562: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_get_entry_contractsReturnsthenumberofcontractsoftheentryorderofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_get_entry_contracts(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_get_entry_contracts(0)

562

Page 563: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_is_pausedReturnstrue/falsevalueindicatingifordersendingispausedforthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_is_paused(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Condition1=pmms_strategy_is_paused(0);

563

Page 564: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_marketpositionReturnsanumericalvaluerepresentingmarketpositionofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_marketposition(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmms_strategy_marketposition(0);

564

Page 565: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_maxiddrawdownReturnsanumericalvaluerepresentingmaxdrawdownofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_maxiddrawdown(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Value1=pmms_strategy_maxiddrawdown(0);

565

Page 566: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_netprofitReturnsanumericalvaluerepresentingnetprofitofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_netprofit(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Value1=pmms_strategy_netprofit(0);

566

Page 567: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_openprofitReturnsanumericalvaluerepresentingunrealizedprofit/lossofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_openprofit(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Value1=pmms_strategy_openprofit(0);

567

Page 568: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_pauseThisfunctiondeniesordersendingforthestrategywithStrategyIndexnumber(allordersofthestrategywillbedeletedfromRawOrdersCollection).

Usage

pmms_strategy_pause(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_pause(0);

568

Page 569: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_resumeThisfunctionallowsordersendingforthestrategywithStrategyIndexnumber(allordersofthestrategywillbedeletedfromRawOrdersCollection).

Usage

pmms_strategy_resume(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_resume(0);

569

Page 570: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_riskcapitalReturnsanumericalvaluerepresentingamountofmoneywithheldasariskcapitalfortheopenpositionofthestrategywithStrategyIndexnumber.

Usage

pmms_strategy_riskcapital(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Value1=pmms_strategy_riskcapital(0);

570

Page 571: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_set_entry_contractsThisfunctionsetsthenumberofcontractsforentryordersofthestrategywithStrategyIndexnumber(sizecalculatedbythestrategyitselfwillbeignored).Tousetheordersizecalculatedbythestrategyitselfsetcontractsparameterto-1.

Usage

pmms_strategy_set_entry_contracts(StrategyIndex,Contracts)

Parameters

StrategyIndex-numericvariable.

Contracts-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_set_entry_contracts(0,5)

571

Page 572: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_set_statusThisfunctionsetsatext(string)statusforthestrategywithStrategyIndexnumberoftheportfolio(statusisindicatedintheCustomTextcolumnofPortfolioReal-TimeWindow).

Usage

pmms_strategy_set_status(StrategyIndex,Status)

Parameters

StrategyIndex-numericvariable.

Status-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_set_status("Long");

572

Page 573: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmms_strategy_symbolReturnsastringvaluerepresentingthenameofinstrumenttowhichthesignalofthestrategywithStrategyIndexnumberisapplied.

Usage

pmms_strategy_symbol(StrategyIndex)

Parameters

StrategyIndex-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmms_strategy_symbol(0);

573

Page 574: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_get_global_named_numReturnsanumericalvalue,indicatingtheglobalnumericalvaluewithVariableNamename.

Usage

pmm_get_global_named_num(VariableName)

Parameters

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmm_get_global_named_num("GlobalVar");

574

Page 575: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_get_global_named_strReturnstheglobalstringvaluewithVariableNamename.

Usage

pmm_get_global_named_str(VariableName)

Parameters

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmm_get_global_named_str("GlobalStr");

575

Page 576: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_get_my_named_numReturnsanumericalvalue,indicatingthevalueofVariableNameofthecurrentstrategy.

Usage

pmm_get_my_named_num(VariableName)

Parameters

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Value1=pmm_get_my_named_num("CustomVar");

576

Page 577: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_get_my_named_strReturnsastringvalue,indicatingthevalueofVariableNameofthecurrentstrategy.

Usage

pmm_get_my_named_str(VariableName)

Parameters

VariableName-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmm_get_my_named_str("CustomStr");

577

Page 578: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_set_global_named_numThisfunctionsetstheglobalnumericvaluewithVariableNamename.

Usage

pmm_set_global_named_num(VariableName,VariableValue)

Parameters

VariableName-stringvariable.

VariableValue-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmm_set_global_named_num("GlobalVar",3);

578

Page 579: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_set_global_named_strThisfunctionsetstheglobalstringvaluewithVariableNamename.

Usage

pmm_set_global_named_str(VariableName,VariableValue)

Parameters

VariableName-stringvariable.

VariableValue-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

ifmarketposition>0thenpmm_set_global_named_str("GlobalStr",symbolname+"isLong");

579

Page 580: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_set_my_named_numThisfunctionsetsthevalueofVariableNameofthecurrentstrategy.

Usage

pmm_set_my_named_num(VariableName,VariableValue)

Parameters

VariableName-stringvariable.

VariableValue-numericvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

pmm_set_my_named_num("MarketPosition",marketposition);

580

Page 581: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_set_my_named_strThisfunctionsetsthestringvalueofVariableNameofthecurrentstrategy.

Usage

pmm_set_my_named_str(VariableName,VariableValue)

Parameters

VariableName-stringvariable.

VariableValue-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

ifmarketposition>0thenpmm_set_my_named_str("Position","Long");

581

Page 582: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

pmm_set_my_statusThisfunctionsetsatext(string)statusforthecurrentstrategyoftheportfolio(statusisindicatedintheCustomTextcolumnofPortfolioReal-TimeWindow).

Usage

pmm_set_my_status(Status)

Parameters

Status-stringvariable.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

ifmarketposition<0thenpmm_set_my_status("Short");

582

Page 583: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_GrossLossReturnsanegativenumericalvalue,indicatingthetotalcurrencyvalueofallcompletedlosingtradesforaportfolio.

Usage

Portfolio_GrossLoss

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_GrossLosswillreturnavalueof-50iftherewereatotaloffourlosingtrades,at10,5,20,and15

Portfolio_GrossLosswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

583

Page 584: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_GrossProfitReturnsanumericalvalue,indicatingthetotalcurrencyvalueofallcompletedwinningtradesforaportfolio.

Usage

Portfolio_GrossProfit

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_GrossProfitwillreturnavalueof50iftherewereatotaloffourwinningtrades,at10,5,20,and15

Portfolio_GrossProfitwillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

584

Page 585: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_InvestedCapitalReturnsabsolutevalueindicatingtheamountofcashassetsinvestedinportfoliosecuritiesonthemomentofstrategycalculation.

Usage

Portfolio_InvestedCapital

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_InvestedCapitalwillreturnavalueof100000iftheamountofcashassetsinvestedinportfoliosecuritiesonthemomentofstrategycalculationis100000unitsoftheselectedcurrency(e.g.therearethreeopenpositions:50000long,20000longand30000short).

585

Page 586: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_MaxIDDrawdownReturnsanegativenumericalvalue,indicatingthelargestdeclineinequityfortheentireportfolioduringthetradingperiod.

Usage

Portfolio_MaxIDDrawdown

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_MaxIDDrawdownwillreturnavalueof-500ifthelargestdeclineinequityduringtheentiretradingperiodwas¤500

586

Page 587: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_NetProfitReturnsanumericalvalue,indicatingthetotalcurrencyvalueofallcompletedtradesforaportfolio.

Usage

Portfolio_NetProfit

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_NetProfitwillreturnavalueof20iftherewerewinningtradesat25and10,andlosingtradesat5and10

Portfolio_NetProfitwillreturnavalueof-15iftherewerewinningtradesat10and5,andlosingtradesat20and10

Portfolio_NetProfitwillreturnavalueof0notradeswerecompletedduringtheentiretradingperiod

587

Page 588: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_NumLossTradesReturnsanumericalvalue,indicatingthenumberofallcompletedlosingtradesforaportfolio.

Usage

Portfolio_NumLossTrades

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_NumLossTradeswillreturnavalueof5iftherewereatotaloffivecompletedlosingtrades

Portfolio_NumLossTradeswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

588

Page 589: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_NumWinTradesReturnsanumericalvalue,indicatingthenumberofallcompletedwinningtradesforaportfolio.

Usage

Portfolio_NumWinTrades

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_NumWinTradeswillreturnavalueof5iftherewereatotaloffivecompletedwinningtrades

Portfolio_NumWinTradeswillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

589

Page 590: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_PercentProfitReturnsanumericalvalue,indicatingthepercentageofwinningtradesinalltradescompletedforaportfolio.

Usage

Portfolio_PercentProfit

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_PercentProfitwillreturnavalueof70ifsevenoutofthetotalof10completedtradeswerewinningtrades

590

Page 591: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_StrategyDrawdownReturnsanegativenumericalvalue,indicatingthecurrentdeclineinequityfortheentireportfoliofromthepeakvaluefortheentiretradingperiod.

Usage

Portfolio_StrategyDrawdown

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_StrategyDrawdownwillreturnavalueof-100ifthecurrentdeclineinequityfromthepeakvalueis¤100

591

Page 592: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_TotalTradesReturnsanumericalvalue,indicatingthetotalnumberofallcompletedtradesforaportfolio.

Usage

Portfolio_TotalTrades

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_TotalTradeswillreturnavalueof5iftherewereatotaloffivecompletedtrades

Portfolio_TotalTradeswillreturnavalueof0ifnotradeswerecompletedduringtheentiretradingperiod

592

Page 593: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_CalcMaxPotentialLossForEntryCalculatesandreturnsmaximumpotentialloss(notincludingmargin,commisionorslippage)ifuserenteredthepositionwiththenumberofContractsandPriceofentry.

Usage

Portfolio_CalcMaxPotentialLossForEntry(Side<,Contracts<,Price>>);

Parametersinsidetheangledbracketsareoptional

Parameters

Sideisanumericalexpressionspecifyingtheentrytype(e.g.1Longentryor-1Shortentry).

Contractsisanoptionalparameterspecifyingthenumberofcontracts.IftheContractsparameterisnotspecified,thenthenumberofcontractsindicatedintheFormatSettingsdialogwindowunderthePropertiestabisusedbydefault.

Priceisanoptionalparameterspecifyingthepricevalue.IfthePriceparameterisnotspecified,thentheClosepricevalueofthecurrentbarwillbeusedbydefault.ThisparametercanberoundeddownifenteredaShortpositionorroundedupifenteredaLongposition.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_CalcMaxPotentialLossForEntry(0,25,High)willreturnavalueof0,sincetheparameterSide=0

593

Page 594: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_CalcMaxPotentialLossForEntry(1,100,Close)willreturnthemaximumpotentialloss(notincludingmargin,commisionorslippage)ifuserenteredaLongpositionfor100contractsattheCloseprice.

Portfolio_CalcMaxPotentialLossForEntry(-1,5,Open)willreturnthemaximumpotentialloss(notincludingmargin,commisionorslippage)ifuserenteredaShortpositionfor5contractsatOpenprice.

Portfolio_CalcMaxPotentialLossForEntry(1)willreturnthemaximumpotentialloss(notincludingmargin,commisionorslippage)iftheuserenteredaLongpositionforanumberofcontractsindicatedintheFormatSettingsdialogwindowunderthePropertiestabatCloseprice.

594

Page 595: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_CurrentEntries

Returnsanumericalvalue,indicatingthecombinednumberofentriescurrentlyopenwithinaportfolio.

Usage

Portfolio_CurrentEntries

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Assignavalue,indicatingthecombinednumberofentriescurrentlyopenwithinaportfolio,toValue1variable:

Value1=Portfolio_CurrentEntries;

595

Page 596: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_MaxOpenPositionPotentialLossReturnsavalueindicatingthecombinedpotentialloss(notincludingmargin,commisionorslippage)forthetradedsymbol'sopenpositionwithintheportfolio.

Usage

SetStopPosition;

SetStopLoss(Portfolio_MaxOpenPositionPotentialLoss);

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

value1=Portfolio_MaxOpenPositionPotentialLoss;

ifvalue1<>0thenbegin

SetStopPosition;

SetStopLoss(value1);

end;

Portfolio_MaxOpenPositionPotentialLosswillreturnavalueof0iftherearecurrentlynoopenpositionswithinaportfolio.

Portfolio_MaxOpenPositionPotentialLosswillreturnavalueof100ifthecombinedpotentiallossforallopenpositionswithinaportfoliois¤100sincethepositionswereentered.

596

Page 597: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_OpenPositionProfit

Returnsanumericalvalue,indicatingthecurrentcombinedprofitorlossforallopenpositionswithinaportfolio.

Usage

Portfolio_OpenPositionProfit

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_OpenPositionProfitwillreturnavalueof0iftherearecurrentlynoopenpositionswithinaportfolio

Portfolio_OpenPositionProfitwillreturnavalueof100ifthecombinedvalueofallopenpositionswithinaportfoliohasincreasedby¤100sincethepositionswereentered

Portfolio_OpenPositionProfitwillreturnavalueof-50ifthecombinedvalueofallopenpositionswithinaportfoliohasdecreasedby¤50sincethepositionswereentered

597

Page 598: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_SetMaxPotentialLossPerContractRedefinesthevaluesfortheindicatedsymbol.Thevaluesinthe¤boxiftheAbsoluteMaxPotentialLossoptionisselectedorthevaluesinthe%boxiftheMaxPotentialLossisselected.

ThenewlysetvalueisvalidduringthestrategycalculationoruntilthePortfolio_SetMaxPotentialLossPerContractisrequestedagainassigninganewvalue.

Usage

Portfolio_SetMaxPotentialLossPerContract(NewValue);

Parameters

NewValueisanumericalvaluethatcanbe:

anabsolutevalueintherange[-100,-0.001];definespercentageofthemaximumpotentiallosspercontract.(MaxPotentialLoss:%)avalueintherange[0.001,1e+29];definesthemaximumpotentiallosspercontractintheselectedcurrency.(AbsoluteMaxPotentialLoss:¤)equal0;inthiscasethevalueenteredintheFormatSettingsdialogwindowunderthePortfolioSettingstabisused.

Portfolio_SetMaxPotentialLossPerContractreturns:

Trueifthevalueisinoneoftherangesindicatedabove.Redefiningisconsideredtobesuccesfull.Falseiftheifthevalueisoutoftherangesindicatedabove.RedefiningisconsideredunsuccessfulandtheMaxPotentialLossvalueisunchanged.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

ThevalueisreturnedinthecurrencyspecifiedinPortfolioTrader:Portfolio

598

Page 599: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Settings->BaseCurrency.

Example

If"MSFT"=SymbolNamethenPortfolio_SetMaxPotentialLossPerContract(-10);thenewvalueof-10isassignedforthesymbol"MSFT"onlyifsuchsymbolisexistintheportfolio.

Portfolio_SetMaxPotentialLossPerContract(-5);redefinesthepercentagevalueofthemaximumpotentiallosspercontractfor5%.

Portfolio_SetMaxPotentialLossPerContract(200);redefinesthemaximumpotentiallosspercontractfor¤200.

599

Page 600: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PortfolioEntriesPriorityAssignsaprioritytoeachentryorderwithinaportfolio.

Ifexecutionofallentriesgeneratedforaportfoliowouldcausethecapitallimitstobeexceeded,theentrieswiththehighestprioritywillreceivepreference,whiletheentrieswiththelowestprioritywillnotbeexecuted.

IfPortfolioEntriesPriorityisnotspecified,theentrieswillbeexecutedaccordingtotheorderthesymbolsarelistedinthesymbolgridofthePortfolioTrader.

Usage

PortfolioEntriesPriority=Priority

Where:Priority-anumericalexpressionspecifyingtheentryorderexecutionpriority;agreatervalueindicatesahigherpriority

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Assignhigherexecutionprioritytoentryordersforsymbolswithlowershareprices:

PortfolioEntriesPriority=(-Close);

600

Page 601: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_GetMarginPerContractReturns:

anumericalvalueindicatedinthe%ofcontractcostboxmultipliedby-1,iftheMarginvalueoptionisselected;or:thesamevalueasareservedwordMarginiftheAbsoluteMarginValueoptionisselected.

Usage

Portfolio_GetMarginPerContract

Parameters

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

TheabsolutemarginvalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_GetMarginPerContractwillreturnavalueof0ifAbsoluteMarginValueoptionisselectedandthemargindoesnotexistintheQuoteManagersymbolsettings.Notallofthesecuritiescanbeboughtonmargin.Themarginvaluecanbereturnedforfuturesoroptions.

Portfolio_GetMarginPerContractwillreturnavalueof25ifAbsoluteMarginValueoptionisselectedandthemarginboxintheEditSymboldialogwindowunderFuturetabinQuoteManagercontainsthevalueof25.

601

Page 602: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_GetMarginPerContractwillreturnavalueof-10iftheMarginValueoptionisselectedandthe%ofcontractcostboxcontainsthevalueof10.

602

Page 603: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_GetMaxPotentialLossPerContractReturns:

anumericalvalueindicatedinthe%boxmultipliedby-1,iftheMaxPotentialLossoptionisselectedintheFormatSettingsdialogwindowunderthePortfolioSettingstab;or:anumericalvalueindicatedintheAbsoluteMaxPotentialLossoptionboxintheFormatSettingsdialogwindowunderthePortfolioSettingstab.

Usage

Portfolio_GetMaxPotentialLossPerContract

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

TheabsolutemaxpotentiallossvalueisreturnedinthecurrencyspecifiedinPortfolioTrader:PortfolioSettings->BaseCurrency.

Example

Portfolio_GetMaxPotentialLossPerContractwillreturn-5iftheMaxPotentialLossoptionisselectedand%boxvalueis5underthePortfolioSettingstabintheFormatSettingsdialogwindow.

Portfolio_GetMaxPotentialLossPerContractwillreturn0.001iftheAbsoluteMaxPotentialLossoptionisselectedand¤boxvalueis0.001underthePortfolioSettingstabintheFormatSettingsdialogwindow.

603

Page 604: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_MaxRiskEquityPerPosPercentReturnstheMax%ofEquityatRiskperPositionnumericalvaluesetbytheuserinthePortfolioSettingstabofthePortfolioTraderFormatSettingswindow.

Usage

Portfolio_MaxRiskEquityPerPosPercent

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_MaxRiskEquityPerPosPercentwillreturntheMax%ofEquityatRiskperPositionnumericalvaluesetbytheuser

604

Page 605: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Portfolio_TotalMaxRiskEquityPercentReturnstheequityExposure%numericalvaluesetbytheuserinthePortfolioSettingstabofthePortfolioTraderFormatSettingswindow.

Usage

Portfolio_TotalMaxRiskEquityPercent

Notes

ThisfunctioncanonlybeusedinsignalsintendedtobeusedwiththePortfolioTrader.

Example

Portfolio_TotalMaxRiskEquityPercentwillreturntheequityExposure%numericalvaluesetbytheuser.

605

Page 606: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AskSizeReturnsanumericalvalueindicatingthecurrentbestAskvolumeforthesymbolthatthestudyisappliedto.

Usage

AskSize

Notes

QuoteFieldscannotbereferencedhistorically.

Example

AskSizewillreturnthecurrentbestAskvolume

606

Page 607: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BidSizeReturnsanumericalvalueindicatingthecurrentbestBidvolumeforthesymbolthatthestudyisappliedto.

Usage

BidSize

Notes

QuoteFieldscannotbereferencedhistorically.

Example

BidSizewillreturnthecurrentbestBidvolume

607

Page 608: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentOpenIntReturnsanumericalvalueindicatingthelastknownopeninterestforthesymbolthatthestudyisappliedto.

Usage

CurrentOpenInt

Notes

QuoteFieldscannotbereferencedhistorically.

Example

CurrentOpenIntwillreturnthelastknownopeninterest

608

Page 609: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyCloseReturnsanumericalvalueindicatingthemostrecentCloseprice.

Usage

DailyClose

Notes

QuoteFieldscannotbereferencedhistorically.

Example

DailyClosewillreturnthemostrecentCloseprice

609

Page 610: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyHighReturnsanumericalvalueindicatingtheHighpriceforthecurrenttradingsession.

Usage

DailyHigh

Notes

QuoteFieldscannotbereferencedhistorically.

Example

DailyHighwillreturntheHighpriceforthecurrenttradingsession

610

Page 611: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyLowReturnsanumericalvalueindicatingtheLowpriceforthecurrenttradingsession.

Usage

DailyLow

Notes

QuoteFieldscannotbereferencedhistorically.

Example

DailyLowwillreturntheLowpriceforthecurrenttradingsession

611

Page 612: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyOpenReturnsanumericalvalueindicatingtheopeningpriceforthecurrenttradingsession.

Usage

DailyOpen

Notes

QuoteFieldscannotbereferencedhistorically.

Example

DailyOpenwillreturntheOpenpriceforthecurrenttradingsession

612

Page 613: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DailyVolumeReturnsanumericalvalueindicatingthecurrenttotaltradevolumeforthetradingsession.

Usage

DailyVolume

Notes

QuoteFieldscannotbereferencedhistorically.

Example

DailyVolumewillreturnthecurrenttotaltradevolume

613

Page 614: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DescriptionReturnsastringexpressioncontainingthedescriptionforthesymbolthatthestudyisappliedto;ifnodescriptionisavailable,ablank("")stringexpressionwillbereturned.

Usage

Description

Example

Descriptionwillreturn"GOOGLEINC"forGoogle

614

Page 615: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExchListedReturnsastringexpressioncontainingtheexchangenameforthesymbolthatthestudyisappliedto.

Usage

ExchListed

Example

ExchListedwillreturn"NASD"forGoogle

ExchListedwillreturn"CME"forE-miniS&P;500

615

Page 616: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InsideAskReturnsanumericalvalueindicatingthecurrentbestAskforthesymbolthatthestudyisappliedto.

Usage

InsideAsk

Notes

QuoteFieldscannotbereferencedhistorically.

Example

InsideAskwillreturnthecurrentbestAsk

616

Page 617: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InsideBidReturnsanumericalvalueindicatingthecurrentbestBidforthesymbolthatthestudyisappliedto.

Usage

InsideBid

Notes

QuoteFieldscannotbereferencedhistorically.

Example

InsideBidwillreturnthecurrentbestBid

617

Page 618: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LastReturnsanumericalvalueindicatingthepriceofthelastcompletedtrade.

Usage

Last

Notes

QuoteFieldscannotbereferencedhistorically.

Example

Lastwillreturnthepriceofthelasttrade

618

Page 619: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PrevCloseReturnsanumericalvalueindicatingtheclosingpriceoftheprevioustradingsession.

Usage

PrevClose

Notes

QuoteFieldscannotbereferencedhistorically.

Example

PrevClosewillreturntheCloseoftheprevioustradingsession

619

Page 620: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_AskRetainedforbackwardcompatibility;replacedwithInsideAsk.

620

Page 621: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_asksizeRetainedforbackwardcompatibility;replacedwithAskSize.

621

Page 622: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_BidRetainedforbackwardcompatibility;replacedwithInsideBid.

622

Page 623: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_bidsizeRetainedforbackwardcompatibility;replacedwithBidSize.

623

Page 624: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_BigPointValueRetainedforbackwardcompatibility;replacedwithBigPointValue.

624

Page 625: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_DateRetainedforbackwardcompatibility;replacedwithTradedDate.

625

Page 626: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_ExchangeListedRetainedforbackwardcompatibility;replacedwithExchListed.

626

Page 627: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_LastRetainedforbackwardcompatibility;replacedwithLast.

627

Page 628: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_OpenInterestRetainedforbackwardcompatibility;replacedwithCurrentOpenInt.

628

Page 629: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_PreviousCloseRetainedforbackwardcompatibility;replacedwithPrevClose.

629

Page 630: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_TimeRetainedforbackwardcompatibility;replacedwithTradeTime.

630

Page 631: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_Time_DtReturnsadouble-precisiondecimalDateTimevalueindicatingcurrenttimefromthestatusline.

Usage

q_Time_Dt

Example

q_Time_Dtwillreturnavalueof39448.25000000for6:00AMonJanuary1st,2008

631

Page 632: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_Time_sSameasq_Time.

TimeisindicatedinHHmmssformat.

632

Page 633: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_TotalVolumeRetainedforbackwardcompatibility;replacedwithDailyVolume.

633

Page 634: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

q_tradevolumeRetainedforbackwardcompatibility;sameasTradeVolume.

634

Page 635: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RTSymbolSameastheRTSymbolName.

635

Page 636: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RTSymbolNameReturnsastringexpressioncontainingthenameofthereal-timesymbolthatthestudyisappliedtoincasethemergingoptionisenabled.IfthemergingoptionisdisabledreturnsthesamevalueastheNameproperty.Incaseofacustomfuturesinstrumentthenameofthelastcontractisreturned.

SeealsoGetRTSymbolName

Usage

RTSymbolName

Example

RTSymbolNamewillreturn"GOOG"forGoogleifthemergingoptionisenabledandGoogleisconfiguredasthereal-timeinstrument.

636

Page 637: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SymbolSameastheSymbolName.

637

Page 638: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SymbolNameReturnsastringexpressioncontainingthenameofthesymbolthatthestudyisappliedto.

SeealsoGetSymbolName

Usage

SymbolName

Example

SymbolNamewillreturn"GOOG"forGoogle

638

Page 639: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TradeDate

Returnsanumericalvalueindicatingthedateofthemostrecentpricefieldupdateforthesymbol.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

TradeDate

Notes

QuoteFieldscannotbereferencedhistorically.

Example

TradeDatewillreturnavalueof1071030forOctober30th,2007

TradeDatewillreturnavalueof990402forApril2th,1999

639

Page 640: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TradeTime

Returnsanumericalvalueindicatingthetimeofthemostrecentpricefieldupdateforthesymbol.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

TradeTime

Notes

QuoteFieldscannotbereferencedhistorically.

Example

TradeTimewillreturnavalueof1015for10:15AM

TradeTimewillreturnavalueof1545for3:45PM

640

Page 641: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TradeVolumeReturnsanumericalvalueindicatingthevolumeofLastPrice.InformationistakenfromtheStatusLine.

Usage

TradeVolume

Notes

QuoteFieldscannotbereferencedhistorically.

Example

TradeVolumewillreturnthevalueof5ifLastSizewas5.

641

Page 642: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AutoSessionReturns0andisusedasanargumentinsessioninformationfunctions.

642

Page 643: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RegularSessionReturns1andisusedasanargumentinsessioninformationfunctions.

643

Page 644: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess1EndTimeThiswordisretainedforbackwardcompatibility.

644

Page 645: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess1FirstBarTimeReturnstheFirstbar'stimeforthefirstsessionofthetradingdayin24-hourformat.PleasenotethattheTimeZonesettingaffectsthevaluereturned.

Example

Sess1FirstBarTimereturns0945whenappliedtoMSFTdatawitha15-minuteinterval

Sess1FirstBarTimereturns0835whenappliedtoE-miniS&P500;Datawitha5-minuteinterval

645

Page 646: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess1StartTimeThiswordisretainedforbackwardcompatibility.

646

Page 647: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess2EndTimeThiswordisretainedforbackwardcompatibility.

647

Page 648: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess2FirstBarTimeReturnstheFirstbar stimeforthesecondsessionofthetradingdayin24-hourformat.PleasenotethattheTimeZonesettingaffectsthevaluereturned.

Example

Sess2FirstBarTimereturns1725whenappliedtoUSTreasuryBondDatawitha5-minuteinterval.

648

Page 649: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Sess2StartTimeThiswordisretainedforbackwardcompatibility.

649

Page 650: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionCountReturnsthenumberofsessionsforthetradingweek.

Usage

SessionCount(SessionType);

Where:SessionType-anumericalexpression:0=AutoDetect,1=RegularSession*

*CustomSessionsparameterswillbeusedifselectedinQuoteManager.

Example

Inthisexample,wehaveassignedtoValue1thetotalnumberofsessionsfortheweekinthecurrentbar.

Value1=SessionCount(0);

Inthisexample,wehaveassignedtoValue1thetotalnumberofregularsessionsfortheweekinthecurrentbar.

Value1=SessionCount(1);

650

Page 651: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionCountMSReturnsthenumberofmergedsessionsforthetradingweek.Mergedsessionsaresessionsbeginningattheearlieststarttimeforallsymbolsandendingatthelatestendtimeforallsymbolseachtradingday.

Example

Inthisexample,wehaveassignedtoValue1thetotalnumberofmergedsessionsfortheweekinthecurrentchart:

Value1=SessionCountMS

651

Page 652: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionEndDayReturnsanumericalvalueindicatingthedayoftheweekthatthespecifiedsessionends,where0=Sunday,1=Monday,etc.

Usage

SessionEndDay(SessionType,SessionNum)

Where:SessionType-anumericalexpression:0=AutoDetect,1=RegularSession*SessionNum-anumericalexpressionspecifyingtheSessionNumber

*CustomSessionsparameterswillbeusedifselectedinQuoteManager.

Example

Assignavalue,indicatingthedayoftheweekthatthe4thregularsessionends,toValue1variable:

Value1=SessionEndDay(1,4)

652

Page 653: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionEndDayMSReturnsanumericalvalueindicatingthedayoftheweekthespecifiedmergedsessioninamulti-dataserieschartends,where0=Sunday,1=Monday,etc.

Mergedsessionextendsfromtheearlieststarttimetothelatestendtimeofallsessionsmerged.

Usage

SessionEndDayMS(SessionNum)

Where:SessionNum-anumericalexpressionspecifyingtheSessionNumber

Example

Assignavalue,indicatingthedayoftheweekthatthe4thmergedsessionends,toValue1variable:

Value1=SessionEndDayMS(4);

653

Page 654: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionEndTime

Returnsanumericalvalue,indicatingthetimeofthedaythatthespecifiedsessionends.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

SessionEndTime(SessionType,SessionNum)

Where:SessionType-anumericalexpression:0=AutoDetect,1=RegularSession*SessionNum-anumericalexpressionspecifyingtheSessionNumber

*CustomSessionsparameterswillbeusedifselectedinQuoteManager.

Example

Assignavalue,indicatingthetimeofthedaythatthe4thregularsessionends,toValue1variable:

Value1=SessionEndTime(1,4);

654

Page 655: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionEndTimeMS

Returnsanumericalvalue,indicatingthetimeofthedaythatthespecifiedmergedsessioninamulti-dataserieschartends.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Mergedsessionextendsfromtheearlieststarttimetothelatestendtimeofallsessionsmerged.

Usage

SessionEndTimeMS(SessionNum)

Where:SessionNum-anumericalexpressionspecifyingtheSessionNumber

Example

Assignavalue,indicatingthetimeofthedaythatthe4thmergedsessionends,toValue1variable:

Value1=SessionEnd(4);

655

Page 656: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionStartDayReturnsanumericalvalueindicatingthedayoftheweekthatthespecifiedsessionstarts,where0=Sunday,1=Monday,etc.

Usage

SessionStartDay(SessionType,SessionNum)

Where:SessionType-anumericalexpression:0=AutoDetect,1=RegularSession*SessionNum-anumericalexpressionspecifyingtheSessionNumber

*CustomSessionsparameterswillbeusedifselectedinQuoteManager.

Example

Assignavalue,indicatingthedayoftheweekthatthe4thregularsessionstarts,toValue1variable:

Value1=SessionStartDay(1,4);

656

Page 657: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionStartDayMSReturnsanumericalvalueindicatingthedayoftheweekthatthespecifiedmergedsessioninamulti-dataserieschartstarts,where0=Sunday,1=Monday,etc.

Mergedsessionextendsfromtheearlieststarttimetothelatestendtimeofallsessionsmerged.

Usage

SessionStartDayMS(SessionNum)

Where:SessionNum-anumericalexpressionspecifyingtheSessionNumber

Example

Assignavalue,indicatingthedayoftheweekthatthe4thmergedsessionstarts,toValue1variable:

Value1=SessionStartDayMS(4);

657

Page 658: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionStartTime

Returnsanumericalvalue,indicatingthetimeofthedaythatthespecifiedsessionstarts.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

SessionStartTime(SessionType,SessionNum)

Where:SessionType-anumericalexpression:0=AutoDetect,1=RegularSession*SessionNum-anumericalexpressionspecifyingtheSessionNumber

*CustomSessionsparameterswillbeusedifselectedinQuoteManager.

Example

Assignavalue,indicatingthetimeofthedaythatthe4thregularsessionstarts,toValue1variable:

Value1=SessionStartTime(1,4);

658

Page 659: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SessionStartTimeMS

Returnsanumericalvalue,indicatingthetimeofthedaythatthespecifiedmergedsessioninamulti-dataserieschartstarts.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Mergedsessionextendsfromtheearlieststarttimetothelatestendtimeofallsessionsmerged.

Usage

SessionStartTimeMS(SessionNum)

Where:SessionNum-anumericalexpressionspecifyingtheSessionNumber

Example

Assignavalue,indicatingthetimeofdaythatthe4thmergedsessionstarts,toValue1variable:

Value1=SessionStartTimeMS(4);

659

Page 660: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

660

Page 661: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AnASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

661

Page 662: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AtASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

662

Page 663: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BasedASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

663

Page 664: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ByASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

664

Page 665: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DoesASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

665

Page 666: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

FromAskipword;usedinstrategyexitstatementsincombinationwithEntrywordthattiesanexittotheparticularentrythatwasassignedtheEntryLabelname.

Anexitcanonlybetiedtoanentrywithinthesamesignal;formoreinformation,seeBuyorSellShort.

SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Usage

FromEntry("EntryLabel")

Where:EntryLabel-thenamethatwasassignedtotheentrythattheexitistobetiedtoFrom-askipwordandcanbeomitted

Example

Completelyexitfromthelongpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

SellFromEntry("OriginalEntry")NextBaratOpen;

666

Page 667: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IsASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

667

Page 668: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OfASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

668

Page 669: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OnASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

669

Page 670: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlaceASkipWordretainedforbackwardcompatibility.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

670

Page 671: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ThanASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

671

Page 672: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TheASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

672

Page 673: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

WasASkipWord.SkipWordsservesolelytoimprovethereadabilityofPowerLanguagecodeandareskipped(ignored)duringthecompilationandexecution.

TheuseofSkipWordsisoptional;theycanbeinsertedanywherewithinthePLcodeandwillappearinredinPowerLanguageEditor.

Example

TheSkipWordsintheexamplebelowarecoloredinred:

IfanOpenis<thanCloseof4BarsAgowasThenBuyThisBaronClose;IfPlot1doesCrossAbovea1350ThenSellFromEntry("MyEntry")NextBarattheMarket;

673

Page 674: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

All

Usedinstrategyexitstatementsinplaceofanumericalexpression,precedingthewordsSharesorContracts,todenoteallofthesharesorallofthecontractsheldwithoutspecifyingtheactualnumberofsharesorcontracts.

Usage

AllContracts

Example

Sellallofthesharesheldatmarketpriceonopenofnextbar:

SellAllSharesNextBarAtMarket;

674

Page 675: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BuyEntersalongpositionasspecifiedbytheparameters.

TheentrypointisvisuallyindicatedonachartbyanArrowandaTick.TheArrowidentifiesthetimeandtheTickidentifiesthepricevalueoftheentrypoint.Labels,displayingtheentrynameandthenumberofcontractsorsharestraded,aredisplayedbelowtheBuyArrow.

Anorderisexecutedatthepointspecifiedbytheparameters;iftheorderisnotfilledwithinthespecifiedbar,theorderiscancelled.

WhenaBuyorderisfilled,anyopenshortpositionswillalsobeclosed.

Usage

Buy[("EntryLabel")][TradeSize]EntryType;

Parametersinsidethesquarebracketsareoptional

ParametersEntryLabel-anoptionalparameter;assignsanamethatwillbedisplayedinthenamelabelbelowtheentry,andcanbeusedtoidentifytheparticularentryandtotieanexittoit.

Anexitcanonlybetiedtoanentrywithinthesamesignal;formoreinformation,seeSell.

IfEntryLabelisnotspecified,thename"Buy"willbeusedforthefirstentry,"Buy#2"forthesecondentry,"Buy#3"forthethirdentry,etc.

TradeSize-anoptionalparameter;anumericalexpression,specifyingthenumberofcontractsorsharestobuy;theexpressionmustbefollowedbyoneofthefollowingtransposablewords:Share,Shares,ContractorContracts.

IfTradeSizevalueequals0orisnegative,alongpositionwillnotbeenteredbutanyopenshortpositionswillbeclosed.

IfTradeSizeisnotspecified,thetradesizevaluesetbytheuserintheProperties

675

Page 676: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

taboftheStrategyPropertieswindowwillbeused.

EntryType-arequiredparameter;specifiesthetimingandpriceofentry.

TherearefourkindsofEntryType:

ThisBar[On]Close

Where:-Onisaskipwordandcanbeomitted

ABuyArrowwillbeplacedatthecurrentbar'sClosetick.

NextBar[At]OpenorNextBar[At]Market

Where:-words"Market"and"Open"aretransposable-Atisaskipwordandcanbeomitted

ABuyArrowwillbeplacedatthenextbar'sOpentick.

NextBar[At]PriceLimit

Where:-Priceisanumericalexpression,specifyingtheLimitPrice-Atisaskipwordandcanbeomitted

ABuyArrowwillbeplacedonthenextbaratthefirsttickwithapricevaluelessthanorequaltoPrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

NextBar[At]PriceStop

Where:-Priceisanumericalexpression,specifyingtheStopPrice-Atisaskipwordandcanbeomitted

ABuyArrowwillbeplacedonthenextbaratthefirsttickwithapricevalueequaltoorgreaterthanthePrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

Example

676

Page 677: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Buyauser-setnumberofsharesatMarketpriceoncloseofthisbar:

BuyThisBarOnClose;

Buy1shareatMarketpriceonopenofnextbarandlabeltheentry"Entry":

Buy("Entry")1ShareNextBarAtOpen;

Buy1contractatMarketpriceonopenofnextbarandlabeltheentry"Entry":

Buy("Entry")1ContractNextBarMarket;

Buy2shareswithinthenextbaronthefirsttickwithapriceof100orless:

Buy2SharesNextBarAt100Limit;

Buy10contractswithinthenextbaronthefirsttickwithapriceof50ormore:

Buy10ContractsNextBar50Stop;

677

Page 678: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BuyToCoverCompletelyorpartiallyexitsoneoralloftheshortentriesasspecifiedbytheparameters.

TheexitpointisvisuallyindicatedonachartbyanArrowandaTick.TheArrowidentifiesthetimeandtheTickidentifiesthepricevalueoftheexitpoint.Labels,displayingtheexitnameandthenumberofcontractsorsharestraded,aredisplayedbelowtheCoverArrow.

Anorderisexecutedatthepointspecifiedbytheparameters;iftheorderisnotfilledwithinthespecifiedbar,theorderiscancelled.

Usage

BuyToCover[("ExitLabel")][FromEntry("EntryLabel")][TradeSize[Total]]Exit

or:

BuyToCover[("ExitLabel")][FromEntry("EntryLabel")][TradeSize[Total]]Exit

Parametersinsidethesquarebracketsareoptional

Parameters

ExitLabel-anoptionalparameter;assignsanamethatwillbedisplayedinthenamelabelabovetheexit

IfExitLabelisnotspecified,thename"Cover"willbeusedforthefirstexit,"Cover#2"forthesecondexit,"Cover#3"forthethirdexit,etc.

EntryLabel-anoptionalparameter;tiestheexittotheparticularentrythatwasassignedtheEntryLabelname;thenamemustbeprecededbythewordEntry,thewordFromisaskipwordandcanbeomitted

Anexitcanonlybetiedtoanentrywithinthesamesignal.Formoreinformation,seeSellShort

IfEntryLabelisnotspecified,alloftheopenshortentrieswillbeclosed.

678

Page 679: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TradeSize-anoptionalparameter;anumericalexpression,specifyingthenumberofcontractsorsharestobuy;theexpressionmustbefollowedbyoneofthefollowingtransposablewords:Share,Shares,ContractorContracts.

Bydefault,thenumberofcontractsorsharesspecifiedbytheTradeSizeparameterwillbecoveredfromeachoftheopenshortentries.

IfTradeSizeisfollowedbythewordTotal,onlythenumberofcontractsorsharesspecifiedbytheTradeSizeparameterwillbecovered,regardlessofthenumberofopenshortentries.Thecontractsorshareswillbecoveredinthesameordertheywereshorted:FirstIn,FirstOut.

IfTradeSizeisnotspecified,theentireshortpositionwillbeclosedout.

Exit-arequiredparameter;specifiesthetimingandpriceofexit.

TherearefourtypesofExit:

ThisBar[On]Close

Where:-Onisaskipwordandcanbeomitted

ACoverArrowwillbeplacedatthecurrentbar'sClosetick.

NextBar[At]OpenorNextBar[At]Market

Where:-words"Market"and"Open"aretransposable-Atisaskipwordandcanbeomitted

ACoverArrowwillbeplacedatthenextbar'sOpentick.

NextBar[At]PriceLimit

Where:-Priceisanumericalexpression,specifyingtheLimitPrice-Atisaskipwordandcanbeomitted

ACoverArrowwillbeplacedonthenextbaratthefirsttickwithapricevaluelessthanorequaltoPrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

679

Page 680: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NextBar[At]PriceStop

Where:-Priceisanumericalexpression,specifyingtheStopPrice-Atisaskipwordandcanbeomitted

ACoverArrowwillbeplacedonthenextbaratthefirsttickwithapricevalueequaltoorgreaterthanthePrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

Example

CompletelyexitallopenshortentriesatMarketpriceoncloseofthisbarandlabeltheexit"CompleteExit":

BuyToCover("CompleteExit")ThisBarOnClose;

Completelyexitfromtheshortpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

BuyToCoverFromEntry("OriginalEntry")NextBarAtOpen;

Cover10sharesoftheshortpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

BuyToCoverEntry("OriginalEntry")10SharesNextBarAtMarket;

Cover5contractsforeachoneoftheopenshortentriesatMarketpriceonopenofnextbar:

BuyToCover5ContractsNextBarMarket;

Coveratotalof1share,regardlessofthenumberofopenshortentries,withinthenextbaronthefirsttickwithapriceof100orless(thefirstshareshortedwillbecoveredifthepriceismet):

BuyToCover1ShareTotalNextBarAt100Limit;

Completelyexitallshortentrieswithinthenextbaronthefirsttickwithapriceof50ormore:

BuyToCoverNextBar50Stop;

680

Page 681: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

681

Page 682: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ContractSameasContracts

682

Page 683: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ContractsUsedinstrategyentryorexitstatementsincombinationwithanumericalexpressiontospecifythenumberofcontractsorsharestotrade.

Usage

TradeSizeContracts

Where:TradeSize-anumericalexpression,specifyingthenumberofcontractsorshares

Example

Buy2contractsatMarketpriceonopenofnextbar:

Buy2ContractsNextBarAtMarket;

683

Page 684: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Cover

UsedincombinationwiththewordsBuyTo;sameasBuyToCover.

Usage

BuyToCover[("ExitLabel")][FromEntry("EntryLabel")][TradeSize[Total]]Exit;

684

Page 685: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryUsedinstrategyexitstatementstotieanexittotheparticularentrythatwasassignedtheEntryLabelname.

Anexitcanonlybetiedtoanentrywithinthesamesignal;formoreinformation,seeBuyorSellShort.

Usage

FromEntry("EntryLabel")

Where:EntryLabel-thenamethatwasassignedtotheentrythattheexitistobetiedtoFrom-askipwordandcanbeomitted

Example

Completelyexitfromthelongpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

SellFromEntry("OriginalEntry")NextBarAtOpen;

685

Page 686: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Higher

Usedinstrategyentryorexitstatementstospecifyapricerangeforanentryoranexit;mustbeprecededbythewordOr.

Usage

AtPriceOrHigher

Where:Price-anumericalexpression,specifyingthebasePriceAt-askipwordandcanbeomitted

Notes

AtPriceOrHigherisanequivalentofaLimitwhenusedwithSellorSellShortstatements,andanequivalentofaStopwhenusedwithBuyorBuyToCoverstatements.

Example

Buywithinthenextbaronthefirsttickwithapriceof100ormore:

BuyNextBarAt100OrHigher;

Sellshortwithinthenextbaronthefirsttickwithapriceof50ormore:

SellShortNextBarAt50OrHigher;

686

Page 687: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LimitUsedinstrategyentryorexitstatementstospecifyaLimitpriceforanentryoranexit.

ALimitorderwillexecuteatthespecifiedpriceorbetter.AbetterpriceisalowerpriceforBuyandBuytocoverorders,andahigherpriceforSellandSellshortorders.

Usage

AtPriceLimit

Where:Price-anumericalexpression,specifyingtheLimitPriceAt-askipwordandcanbeomitted

Example

Buywithinthenextbaronthefirsttickwithapriceof100orless:

BuyNextBarAt100Limit;

Sellshortwithinthenextbaronthefirsttickwithapriceof50ormore:

SellShortNextBar50Limit;

687

Page 688: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LowerUsedinstrategyentryorexitstatementstospecifyapricerangeforanentryoranexit.

MustbeprecededbythewordOr.

Usage

AtPriceOrLower

Where:Price-anumericalexpression,specifyingthebasePriceAt-askipwordandcanbeomitted

Notes

AtPriceOrLowerisanequivalentofaLimitwhenusedwithBuyorBuyToCoverstatements,andanequivalentofaStopwhenusedwithSellorSellShortstatements.

Example

Buywithinthenextbaronthefirsttickwithapriceof100orless:

BuyNextBarAt100OrLower;

Sellshortwithinthenextbaronthefirsttickwithapriceof50orless:

SellShortNextBarAt50OrLower;

688

Page 689: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketUsedinstrategyentryorexitstatementstospecifyaMarketpriceforanentryoranexit.

AMarketBuyorderwillexecuteatthecurrentaskpriceandaMaretSellorderwillexecuteatthecurrentbidprice.

Usage

AtMarket

Where:Atisaskipwordandcanbeomitted

Example

Buyauser-setnumberofsharesatMarketpriceonopenofnextbar:

BuyNextBarAtMarket;

689

Page 690: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SellCompletelyorpartiallyexitsoneorallofthelongentriesasspecifiedbytheparameters.

TheexitpointisvisuallyindicatedonachartbyanArrowandaTick.TheArrowidentifiesthetimeandtheTickidentifiesthepricevalueoftheexitpoint.Labels,displayingtheexitnameandthenumberofcontractsorsharestraded,aredisplayedabovetheSellArrow.

Anorderisexecutedatthepointspecifiedbytheparameters;iftheorderisnotfilledwithinthespecifiedbar,theorderiscancelled.

UsageSell[("ExitLabel")][FromEntry("EntryLabel")][TradeSize[Total]]Exit

Parametersinsidethesquarebracketsareoptional

ParametersExitLabel-anoptionalparameter;assignsanamethatwillbedisplayedinthenamelabelabovetheexit

IfExitLabelisnotspecified,thename"Sell"willbeusedforthefirstexit,"Sell#2"forthesecondexit,"Sell#3"forthethirdexit,etc.

EntryLabel-anoptionalparameter;tiestheexittotheparticularentrythatwasassignedtheEntryLabelname;thenamemustbeprecededbytheword"Entry",theword"From"isaskipwordandcanbeomitted

Anexitcanonlybetiedtoanentrywithinthesamesignal.Formoreinformation,seeBuy

IfEntryLabelisnotspecified,alloftheopenlongentrieswillbeclosed.

TradeSize-anoptionalparameter;anumericalexpression,specifyingthenumberofcontractsorsharestosell;theexpressionmustbefollowedbyoneofthefollowingtransposablewords:Share,Shares,ContractorContracts.

Bydefault,thenumberofcontractsorsharesspecifiedbytheTradeSizeparameterwillbesoldfromeachoneoftheopenlongentries.

IfTradeSizeisfollowedbytheword"Total",onlythenumberofcontractsor

690

Page 691: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

sharesspecifiedbytheTradeSizeparameterwillbesold,regardlessofthenumberofopenlongentries.Thecontractsorshareswillbesoldinthesameordertheywerebought:FirstIn,FirstOut.

IfTradeSizeisnotspecified,theentirelongpositionwillbeclosedout.

Exit-arequiredparameter;specifiesthetimingandpriceofexit.

TherearefourtypesofExit:

ThisBar[On]Close

Where:-Onisaskipwordandcanbeomitted

ASellArrowwillbeplacedatthecurrentbar'sClosetick.

NextBar[At]OpenorNextBar[At]Market

Where:-words"Market"and"Open"aretransposable-Atisaskipwordandcanbeomitted

ASellArrowwillbeplacedatthenextbar'sOpentick.

NextBar[At]PriceLimit

Where:-Priceisanumericalexpression,specifyingtheLimitPrice-Atisaskipwordandcanbeomitted

ASellArrowwillbeplacedonthenextbaratthefirsttickwithapricevaluegreaterthanorequaltoPrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

NextBar[At]PriceStop

Where:-Priceisanumericalexpression,specifyingtheStopPrice-Atisaskipwordandcanbeomitted

ASellArrowwillbeplacedonthenextbaratthefirsttickwithapricevalueequaltoorlessthanthePrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

691

Page 692: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

CompletelyexitallopenlongentriesatMarketpriceoncloseofthisbarandlabeltheexit"CompleteExit":

Sell("CompleteExit")ThisBarOnClose;

Completelyexitfromthelongpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

SellFromEntry("OriginalEntry")NextBarAtOpen;

Sell10sharesofthelongpositionestablishedbytheentrylabeled"OriginalEntry",atMarketpriceonopenofnextbar:

SellEntry("OriginalEntry")10SharesNextBarAtMarket;

Sell5contractsforallopenlongentriesatMarketpriceonopenofnextbar:

Sell5ContractsNextBarMarket;

Sellatotalof1share,regardlessofthenumberofopenlongentries,withinthenextbaronthefirsttickwithapriceof100ormore(thelongest-heldsharewillbesoldifthepriceismet):

Sell1ShareTotalNextBarAt100Limit;

Completelyexitalllongentrieswithinthenextbaronthefirsttickwithapriceof50orless:

SellNextBar50Stop;

692

Page 693: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SellShortEntersashortpositionasspecifiedbytheparameters.

TheentrypointisvisuallyindicatedonachartbyanArrowandaTick.TheArrowidentifiesthetimeandtheTickidentifiesthepricevalueoftheentrypoint.Labels,displayingtheentrynameandthenumberofcontractsorsharestraded,aredisplayedabovetheShortArrow.

Anorderisexecutedatthepointspecifiedbytheparameters;iftheorderisnotfilledwithinthespecifiedbar,theorderiscancelled.

WhenaSellShortorderisfilled,anyopenlongpositionswillalsobeclosed.

Usage

SellShort[("EntryLabel")][TradeSize]Entry

or:

SellShort[("EntryLabel")][TradeSize]Entry

Parametersinsidethesquarebracketsareoptional

Parameters

EntryLabel-anoptionalparameter;assignsanamethatwillbedisplayedinthenamelabelabovetheentry,andcanbeusedtoidentifytheparticularentryandtotieanexittoit.

Anexitcanonlybetiedtoanentrywithinthesamesignal;formoreinformation,seeBuyToCover.

IfEntryLabelisnotspecified,thename"Short"willbeusedforthefirstentry,"Short#2"forthesecondentry,"Short#3"forthethirdentry,etc.

TradeSize-anoptionalparameter;anumericalexpression,specifyingthenumberofcontractsorsharestosellshort;theexpressionmustbefollowedbyoneofthefollowingtransposablewords:Share,Shares,ContractorContracts.

693

Page 694: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

IfTradeSizevalueequals0orisnegative,ashortpositionwillnotbeenteredbutanyopenlongpositionswillbeclosed.

IfTradeSizeisnotspecified,thetradesizevaluesetbytheuserinthePropertiestaboftheStrategyPropertieswindowwillbeused.

Entry-arequiredparameter;specifiesthetimingandpriceofentry.

TherearefourtypesofEntry:

ThisBar[On]Close

Where:-Onisaskipwordandcanbeomitted

AShortArrowwillbeplacedatthecurrentbar'sClosetick.

NextBar[At]OpenorNextBar[At]Market

Where:-words"Market"and"Open"aretransposable-Atisaskipwordandcanbeomitted

AShortArrowwillbeplacedatthenextbar'sOpentick.

NextBar[At]PriceLimit

Where:-Priceisanumericalexpression,specifyingtheLimitPrice-Atisaskipwordandcanbeomitted

AShortArrowwillbeplacedonthenextbaratthefirsttickwithapriceequaltoorgreaterthanthePrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

NextBar[At]PriceStop

Where:-Priceisanumericalexpression,specifyingtheStopPrice-Atisaskipwordandcanbeomitted

AShortArrowwillbeplacedonthenextbaratthefirsttickwithapricevaluelessthanorequaltoPrice;iftherearenosuchtickswithinthenextbar,theorderwillbecancelled.

694

Page 695: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

SellShortauser-setnumberofsharesatMarketpriceoncloseofthisbar:

SellShortThisBarOnClose;

SellShort1shareatMarketpriceonopenofnextbarandlabeltheentry"Entry":

SellShort("Entry")1ShareNextBarAtOpen;

SellShort1contractatMarketpriceonopenofnextbarandlabeltheentry"Entry":

SellShort("Entry")1ContractNextBarMarket;

SellShort2shareswithinthenextbaronthefirsttickwithapriceof100ormore:

SellShort2SharesNextBarAt100Limit;

SellShort10contractswithinthenextbaronthefirsttickwithapriceof50orless:

SellShort10ContractsNextBar50Stop;

695

Page 696: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetBreakEvenClosesouttheentirepositionortheentryifitisatthebreakevenpointaftertheprofithasreachedthespecifiedvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhetherSetBreakEvenwillbeappliedtotheentirepositionortoeachcontractorshareindividually;bydefault,SetBreakEvenisappliedtotheentireposition.

SetBreakEvenfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetBreakEven(Profit)

Where:Profit-anumericalexpression,specifyingthecurrencyvalueoftheprofitthatmustbereachedfirst

Notes

Thisfunctioncanonlybeusedinsignals.

SetBreakEvenfunctiondoesnotfactorincommissionsorslippage.

Amountcanbeseteitherinthecurrencyofthesymbolorinthecurrecyofthestrategy,dependingonthekeysetinWindowsRegistry.

GotoHKEY_CURRENT_USER\Software\TSSupport\[ProductName]\StrategyPropandcreateakeyDWORDValue:SpecOrdersAmountIsStrategyCurr.

0-tocalculateAmountinthecurrencyofthesymbol.

1-tocalculateAmountinthecurrencyofthestrategy/Portfolio(bydefault).

[ProductName]isnameofproduct,forexample,for32-bitMultiCharts="MultiCharts",for64-bitversion="MultiCharts64".

696

Page 697: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Ifthereisnosuchakey,Amountiscalculatedinthecurrencyofthestrategy/Portfolio.

Example

Generateanexitorderfortheentirepositionifitisatthebreakevenpointafterpositionprofithasreached¤50:

SetStopPosition;

SetBreakEven(50);

Generateanexitorderfortheentryifitisatthebreakevenpointafterpercontractprofithasreached¤10:

SetStopContract;

SetBreakEven(10);

697

Page 698: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetBreakEven_ptClosesouttheentirepositionortheentryifitisatthebreakevenpointaftertheprofithasreachedthespecifiedtickvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhethersingleSetBreakEven_ptorderwillbeappliedtotheentirepositionormultipleSetBreakEven_ptorderswillbeappliedtoeachentryinpositionindividually;bydefault,SetBreakEven_ptisappliedtotheentireposition.

SetBreakEven_ptfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetBreakEven_pt(Profit)

Where:Profit-anumericalexpression,specifyingtheamountoftheprofitinticksthatmustbereachedfirst

Notes

Thisfunctioncanonlybeusedinsignals.

SetBreakEven_ptfunctiondoesnotfactorincommissionsorslippage.

Example

Generateanexitorderfortheentirepositionifitisatthebreakevenpointafterpositionprofithasreached50ticks:

SetStopPosition;

SetBreakEven_pt(50);

Generateanexitorderfortheentryifitisatthebreakevenpointafterperentery

698

Page 699: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

profithasreached10ticks:

SetStopContract;

SetBreakEven_pt(10);

699

Page 700: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetDollarTrailingClosesouttheentirepositionortheentryifthecurrentprofitislessthanthemaximumprofitbythespecifiedamount;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

Forexample,ifthespecifiedammountis¤50andtheprofithasreachedthemaximumof¤120,thepositionwillbeclosedoncetheprofitdropsto¤70.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhetherSetDollarTrailingwillbeappliedtotheentirepositionortoeachcontractorshareindividually;bydefault,SetDollarTrailingisappliedtotheentireposition.

SetDollarTrailingfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetDollarTrailing(Amount)

Where:Amount-anumericalexpression,specifyingthecurrencyvalueofthemaximumlossofprofit

Notes

Thisfunctioncanonlybeusedinsignals.

Amountcanbeseteitherinthecurrencyofthesymbolorinthecurrecyofthestrategy,dependingonthekeysetinWindowsRegistry.

GotoHKEY_CURRENT_USER\Software\TSSupport\[ProductName]\StrategyPropandcreateakeyDWORDValue:SpecOrdersAmountIsStrategyCurr.

0-tocalculateAmountinthecurrencyofthesymbol.

1-tocalculateAmountinthecurrencyofthestrategy/Portfolio(bydefault).

[ProductName]isnameofproduct,forexample,for32-bitMultiCharts=

700

Page 701: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

"MultiCharts",for64-bitversion="MultiCharts64".

Ifthereisnosuchakey,Amountiscalculatedinthecurrencyofthestrategy/Portfolio.

Example

Generateanexitorderfortheentirepositionifpositionprofitdropsby¤50:

SetStopPosition;

SetDollarTrailing(50);

Generateanexitorderfortheentryifpercontractprofitdropsby¤10:

SetStopContract;

SetDollarTrailing(10);

701

Page 702: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetExitOnCloseClosesoutthecurrentpositionattheClosetickofthelastbarofthetradingsessiononanintra-daychart;generatestheappropriateMarketexitorderdependingonwhetherthepositionislongorshort.

SetExitOnClosefunctionusesthesessionclosingtimespecifiedinthesessionsettingsforthesymbolintheQuoteManager.

Usage

SetExitOnClose

Notes

Thisfunctioncanonlybeusedinsignals.

Example

GenerateanexitorderattheClosetickofthelastbarofthetradingsession:

SetExitOnClose;

702

Page 703: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetPercentTrailingClosesouttheentirepositionortheentryifthespecifiedpercentageofthemaximumprofitislostaftertheprofithasreachedthespecifiedvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

Forexample,ifthespecifiedprofitis¤100andthespecifiedpercentageis50,andtheprofithasreachedthemaximumof¤120,thepositionwillbeclosedoncetheprofitfallsbackto¤60.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhetherSetPercentTrailingwillbeappliedtotheentirepositionoreachcontractorshareindividually;bydefault,SetPercentTrailingisappliedtotheentireposition.

SetPercentTrailingfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetPercentTrailing(Profit,Percentage)

Where:Profit-anumericalexpression,specifyingthecurrencyvalueoftheprofitthatmustbereachedfirstPercentage-anumericalexpression,specifyingthemaximumlossofprofitinpercent

Notes

Thisfunctioncanonlybeusedinsignals.

Amountcanbeseteitherinthecurrencyofthesymbolorinthecurrecyofthestrategy,dependingonthekeysetinWindowsRegistry.

GotoHKEY_CURRENT_USER\Software\TSSupport\[ProductName]\StrategyPropandcreateakeyDWORDValue:SpecOrdersAmountIsStrategyCurr.

0-tocalculateAmountinthecurrencyofthesymbol.

703

Page 704: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

1-tocalculateAmountinthecurrencyofthestrategy/Portfolio(bydefault).

[ProductName]isnameofproduct,forexample,for32-bitMultiCharts="MultiCharts",for64-bitversion="MultiCharts64".

Ifthereisnosuchakey,Amountiscalculatedinthecurrencyofthestrategy/Portfolio.

Example

Generateanexitorderfortheentirepositionif50percentofmaximumpositionprofitislostaftertheprofithasreached¤25:

SetStopPosition;

SetPercentTrailing(25,50);

Generateanexitorderfortheentryif25percentofmaximumpershareprofitislostaftertheprofithasreached¤5:

SetStopShare;

SetPercentTrailing(5,25);

704

Page 705: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetPercentTrailing_ptClosesouttheentirepositionortheentryifthespecifiedpercentageofthemaximumprofitislostaftertheprofithasreachedthespecifiedtickvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

Forexample,ifthespecifiedprofitis100ticksandthespecifiedpercentageis50,andtheprofithasreachedthemaximumof120ticks,thepositionwillbeclosedoncetheprofitfallsbackto60ticks.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhethersingleSetPercentTrailing_ptorderwillbeappliedtotheentirepositionormultipleSetPercentTrailing_ptorderswillbeappliedtoeachentryinpositionindividually;bydefault,SetPercentTrailing_ptisappliedtotheentireposition.

SetPercentTrailing_ptfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetPercentTrailing_pt(Profit,Percentage)

Where:Profit-anumericalexpression,specifyingthetickvalueoftheprofitthatmustbereachedfirstPercentage-anumericalexpression,specifyingthemaximumlossofprofitinpercent

Notes

Thisfunctioncanonlybeusedinsignals.

SetPercentTrailing_ptfunctiondoesnotfactorincommissionsorslippage.

Example

Generateanexitorderfortheentirepositionif50percentofmaximumposition

705

Page 706: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

profitislostaftertheprofithasreached25ticks:

SetStopPosition;

SetPercentTrailing_pt(25,50);

Generateanexitorderfortheentryif25percentofmaximumperentryprofitislostaftertheprofithasreached5ticks:

SetStopShare;

SetPercentTrailing_pt(5,25);

706

Page 707: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetProfitTargetClosesouttheentirepositionortheentryifprofitreachesthespecifiedcurrencyvalue;generatestheappropriateLimitexitorderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhethertheprofittargetwillbeappliedtotheentirepositionortoeachcontractorshareindividualy;bydefault,profittargetisappliedtotheentireposition.

SetProfitTargetfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetProfitTarget(Amount)

Where:Amount-anumericalexpression,specifyingtheprofittargetamount

Notes

Thisfunctioncanonlybeusedinsignals.

Amountcanbeseteitherinthecurrencyofthesymbolorinthecurrecyofthestrategy,dependingonthekeysetinWindowsRegistry.

GotoHKEY_CURRENT_USER\Software\TSSupport\[ProductName]\StrategyPropandcreateakeyDWORDValue:SpecOrdersAmountIsStrategyCurr.

0-tocalculateAmountinthecurrencyofthesymbol.

1-tocalculateAmountinthecurrencyofthestrategy/Portfolio(bydefault).

[ProductName]isnameofproduct,forexample,for32-bitMultiCharts="MultiCharts",for64-bitversion="MultiCharts64".

Ifthereisnosuchakey,Amountiscalculatedinthecurrencyofthestrategy/Portfolio.

707

Page 708: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

Generateanexitorderfortheentirepositionifthepositionprofitreaches¤100:

SetStopPosition;

SetProfitTarget(100);

Generateanexitorderfortheentryiftheprofitpercontractreaches¤10:

SetStopContract;

SetProfitTarget(10);

708

Page 709: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetProfitTarget_ptClosesouttheentirepositionortheentryifprofitreachesthespecifiedtickvalue;generatestheappropriateLimitexitorderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhethersingleprofittargetorderwillbeappliedtotheentirepositionormultipleSetProfitTarget_ptorderswillbeappliedtoeachentryinpositionindividualy;bydefault,profittargetisappliedtotheentireposition.

SetProfitTarget_ptfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetProfitTarget_pt(Amount)

Where:Amount-anumericalexpression,specifyingtheprofittargetamountinticks.

Notes

Thisfunctioncanonlybeusedinsignals.

SetProfitTarget_ptfunctiondoesnotfactorincommissionsorslippage.

Example

Generateanexitorderfortheentirepositionifthepositionprofitreaches100ticks:

SetStopPosition;

SetProfitTarget_pt(100);

Generateanexitorderfortheentryiftheprofitperentryreaches10ticks:

709

Page 710: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopContract;

SetProfitTarget_pt(10);

710

Page 711: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopContractForcesthebuilt-instrategyexitfunctionstobeappliedonpercontractorsharebasis.

Thebuilt-instrategyexitfunctionsare:SetStopLoss,SetProfitTarget,SetBreakEven,SetDollarTrailing,andSetPercentTrailing.

Usage

SetStopContract

Notes

IfSetStopPositon,SetStopContract,andSetStopSharewerenotused,theexitfunctionswillbeappliedontheentirepositionbasisasadefault.

IfSetStopPositon,SetStopContract,andSetStopSharewereusedinmultipleinstancesorindifferentsignalsappliedtothesamechart,thelastinstancewillbecontrolling.

Example

ForcetheSetStopLossstrategyexitfunctiontobeappliedonpercontractbasis:

SetStopContract;

SetStopLoss(10);

Anexitorderfortheentrywillbegeneratedifthelosspercontractreaches¤10.

711

Page 712: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopLossClosesouttheentirepositionortheentryifthelossreachesthespecifiedcurrencyvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhetherthestoplosswillbeappliedtotheentirepositionortoeachcontractorshareindividually;bydefault,stoplossisappliedtotheentireposition.

SetStopLossfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetStopLoss(Amount)

Where:Amount-anumericalexpression,specifyingthestoplossamount

Notes

Thisfunctioncanonlybeusedinsignals.

Amountcanbeseteitherinthecurrencyofthesymbolorinthecurrecyofthestrategy,dependingonthekeysetinWindowsRegistry.

GotoHKEY_CURRENT_USER\Software\TSSupport\[ProductName]\StrategyPropandcreateakeyDWORDValue:SpecOrdersAmountIsStrategyCurr.

0-tocalculateAmountinthecurrencyofthesymbol.

1-tocalculateAmountinthecurrencyofthestrategy/Portfolio(bydefault).

[ProductName]isnameofproduct,forexample,for32-bitMultiCharts="MultiCharts",for64-bitversion="MultiCharts64".

Ifthereisnosuchakey,Amountiscalculatedinthecurrencyofthestrategy/Portfolio.

712

Page 713: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

Generateanexitorderfortheentirepositionifthepositionlossreaches¤100:

SetStopPosition;

SetStopLoss(100);

Generateanexitorderfortheentryifthelosspercontractreaches¤10:

SetStopContract;

SetStopLoss(10);

713

Page 714: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopLoss_ptClosesouttheentirepositionortheentryifthelossreachesthespecifiedtickvalue;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhethersinglestoplosswillbeappliedtotheentirepositionormultipleSetStopLoss_ptorderswillbeappliedtoeachentryinpositionindividually;bydefault,stoplossisappliedtotheentireposition.

SetStopLoss_ptfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetStopLoss_pt(Amount)

Where:Amount-anumericalexpression,specifyingthestoplossamountinticks.

Notes

Thisfunctioncanonlybeusedinsignals.

SetStopLoss_ptfunctiondoesnotfactorincommissionsorslippage.

Example

Generateanexitorderfortheentirepositionifthepositionlossreaches100ticks:

SetStopPosition;

SetStopLoss_pt(100);

Generateanexitorderfortheentryifthelossperentryreaches10ticks:

SetStopContract;

714

Page 715: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopLoss_pt(10);

715

Page 716: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopPositionForcesthebuilt-instrategyexitfunctionstobeappliedontheentirepositionbasis.

Thebuilt-instrategyexitfunctionsare:SetStopLoss,SetProfitTarget,SetBreakEven,SetDollarTrailing,andSetPercentTrailing.

Usage

SetStopPosition

Notes

IfSetStopPositon,SetStopContract,andSetStopSharewerenotused,theexitfunctionswillbeappliedontheentirepositionbasisasadefault.

IfSetStopPositon,SetStopContract,andSetStopSharewereusedinmultipleinstancesorindifferentsignalsappliedtothesamechart,thelastinstancewillbecontrolling.

Example

ForceSetStopLossstrategyexitfunctiontobeappliedontheentirepositionbasis:

SetStopPosition;

SetStopLoss(100);

Anexitorderfortheentirepositionwillbegeneratedifthepositionlossreaches¤100.

716

Page 717: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetStopShareSameasSetStopContract

717

Page 718: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetTrailingStop_ptClosesouttheentirepositionortheentryifthecurrentprofitislessthanthemaximumprofitbythespecifiedamount;generatestheappropriateStoporderdependingonwhetherthepositionislongorshort.

Forexample,ifthespecifiedammountis50ticksandtheprofithasreachedthemaximumof120ticks,thepositionwillbeclosedoncetheprofitdropsto70ticks.

SetStopPositionandSetStopContractorSetStopSharefunctionsdeterminewhetherSetTrailingStop_ptwillbeappliedtotheentirepositionortoeachentryinpositionindividually;bydefault,SetTrailingStop_ptisappliedtotheentireposition.

SetTrailingStop_ptfunctionisevaluatedintra-barandnotonlyoncloseofabar,andcanexitwithinthesamebarastheentry.

Usage

SetDollarTrailing_pt(Amount)

Where:Amount-anumericalexpression,specifyingthetickvalueofthemaximumlossofprofitinticks.

Notes

Thisfunctioncanonlybeusedinsignals.

SetTrailingStop_ptfunctiondoesnotfactorincommissionsorslippage.

Example

Generateanexitorderfortheentirepositionifpositionprofitdropsby50ticks:

SetStopPosition;

SetDollarTrailing_pt(50);

718

Page 719: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Generateanexitorderfortheentryifperentryprofitdropsby10ticks:

SetStopContract;

SetDollarTrailing_pt(10);

719

Page 720: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ShareSameasShares

720

Page 721: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Shares

Usedinstrategyentryorexitstatementsincombinationwithanumericalexpressiontospecifythenumberofsharesorcontractstotrade.

Usage

TradeSizeShares

Where:TradeSize-anumericalexpression,specifyingthenumberofsharesorcontracts

Example

Buy2sharesatMarketpriceonopenofnextbar:

Buy2SharesNextBarAtMarket;

721

Page 722: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Short

UsedincombinationwiththewordSell;sameasSellShort.

Usage

SellShort[("EntryLabel")][TradeSize]Entry;

722

Page 723: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StopUsedinstrategyentryorexitstatementstospecifyaStoppriceforanentryoranexit.

AStoporderwillexecuteatthespecifiedpriceorworse.AworsepriceisahigherpriceforBuyandBuytocoverorders,andalowerpriceforSellandSellshortorders.

Usage

AtPriceStop

Where:Price-anumericalexpression,specifyingtheLimitPriceAt-askipwordandcanbeomitted

Example

Sellwithinthenextbaronthefirsttickwithapriceof100orless:

SellNextBar100Stop;

Coverwithinthenextbaronthefirsttickwithapriceof50ormore:

BuyToCoverNextBarAt50Stop;

723

Page 724: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TotalUsedinstrategyexitstatements,followinganumericalexpressionandthewordsSharesorContracts,toindicatethatonlythenumberofcontractsorsharesspecifiedbythenumericalexpressionistobesoldorcoveredintotal,regardlessofthenumberofopenentries.Thecontractsorshareswillbesoldorcoveredinthesameordertheywereboughtorshorted:FirstIn,FirstOut.

IfthewordTotalisnotused,thenumberofcontractsorsharesspecifiedbythenumericalexpressionwillbesoldorcoveredforeachoneoftheopenentries.

Usage

TradeSizeSharesTotal

Where:TradeSize-anumericalexpression,specifyingthenumberofsharesorcontracts

Example

Sellatotalof2contracts,regardlessofthenumberofopenlongentries,atMarketpriceonopenofnextbar:

Sell2ContractsTotalNextBarAtMarket;

724

Page 725: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgBarsEvenTradeReturnsanumericalvalue,indicatingtheaveragenumberofbarsapositionwasheldduringallcompletedeventrades.

Usage

AvgBarsEvenTrade

Notes

Thisfunctioncanonlybeusedinsignals.

Example

AvgBarsEvenTradewillreturnavalueof3.5iffoureventradesheldpositionsfor2,5,3,and4bars

725

Page 726: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgBarsLosTradeReturnsanumericalvalue,indicatingtheaveragenumberofbarsapositionwasheldduringallcompletedlosingtrades.

Usage

AvgBarsLosTrade

Notes

Thisfunctioncanonlybeusedinsignals.

Example

AvgBarsLosTradewillreturnavalueof3.5iffourlosingtradesheldpositionsfor2,5,3,and4bars

726

Page 727: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgBarsWinTradeReturnsanumericalvalue,indicatingtheaveragenumberofbarsapositionwasheldduringallcompletedwinningtrades.

Usage

AvgBarsWinTrade

Notes

Thisfunctioncanonlybeusedinsignals.

Example

AvgBarsWinTradewillreturnavalueof3.5iffourwinningtradesheldpositionsfor2,5,3,and4bars

727

Page 728: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgEntryPriceReturnsanumericalvalue,indicatingtheaverageentrypriceforallopenentriesinapyramidedposition.

Usage

AvgEntryPrice

Notes

Thisfunctioncanonlybeusedinsignals.

Example

AvgEntryPricewillreturnavalueof101iftherewerethreeopenentriesat95,105,and103

728

Page 729: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgEntryPrice_at_Broker

Returnsanumericalvalue,indicatingtheaverageentrypriceatthebrokerforthesymbol.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

AvgEntryPrice_at_Broker

Notes

Thisfunctioncanonlybeusedinsignalsandfunctions.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

Example

AvgEntryPrice_at_Brokerwillreturnavalueof102ifbrokerhasreturnedthevalueof102forthecurrenttradinginstrument.

729

Page 730: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

AvgEntryPrice_at_Broker_for_The_StrategyReturnsanumericalvalue,indicatingtheaverageentrypriceatthebrokerforthestrategy.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

AvgEntryPrice_at_Broker_for_The_Strategy

Notes

Thisfunctioncanonlybeusedinsignalsandfunctions.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

Example

AvgEntryPrice_at_Broker_for_The_Strategywillreturnavalueof100ifthereweretwo1contractentriesforthecurrentstrategy:at98and102.

730

Page 731: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GrossLossReturnsanegativenumericalvalue,indicatingthetotalcurrencyvalueofallcompletedlosingtrades.

Usage

GrossLoss

Notes

Thisfunctioncanonlybeusedinsignals.

Example

GrossLosswillreturnavalueof-50iftherewereatotaloffourlosingtrades,at10,5,20,and15

GrossLosswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

731

Page 732: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GrossProfitReturnsanumericalvalue,indicatingthetotalcurrencyvalueofallcompletedwinningtrades.

Usage

GrossProfit

Note

Thisfunctioncanonlybeusedinsignals.

Example

GrossProfitwillreturnavalueof50iftherewereatotaloffourwinningtrades,at10,5,20,and15

GrossProfitwillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

732

Page 733: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_AvgEntryPriceSameasAvgEntryPriceexceptusedinindicators.

733

Page 734: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_AvgEntryPrice_at_BrokerReturnstheAverageentrypriceofeachopenentryinapyramidedposition.

Usage

i_AvgEntryPrice_at_Broker

Notes

i_AvgEntryPrice_at_Brokeronlyreturnstheaverageentrypriceforopentrades.

i_AvgEntryPrice_at_Brokercanonlybeusedinanindicator.

i_AvgEntryPrice_at_Brokerwillonlyreturnavalueifasignalisappliedtothesamedata.

Example

i_AvgEntryPrice_at_Brokerreturns170ifthreetradesarecurrentlyopenandwereenteredatapriceof140,170,and200.

i_AvgEntryPrice_at_Brokerreturns53iffourtradesarecurrentlyopenandwereenteredatapriceof54,48,60,and50.

734

Page 735: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_AvgEntryPrice_at_Broker_for_The_StrategyIsusedfortheextractionofstrategyinformationinindicator.

ReturnsthesameinformationasAvgEntryPrice_at_Broker_for_The_Strategy.

735

Page 736: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_ClosedEquityReturnstheprofitorlossrealizedwhenapositionhasbeenclosed.

Usage

i_ClosedEquity

Notes

Thisfunctioncanonlybeusedinindicators.

Example

i_ClosedEquitywillreturn100iftheclosedequityis100.

736

Page 737: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_CurrentContractsSameasCurrentContractsexceptusedinindicators.

737

Page 738: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_CurrentSharesSameasCurrentSharesexceptusedinindicators.

738

Page 739: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_MarketPositionReturnsanumericalvalue,indicatingthetypeofthespecifiedposition.

Avalueof1indicatesthecurrentbarhasalongposition,-1indicatesthecurrentbarhasashortposition,and0isreturnedonlyifthecurrentbarhasaflatposition.

Usage

i_MarketPosition

Notes

Thisfunctioncanonlybeusedinindicators.

Example

i_MarketPositionwillreturnavalueof0ifthepositiononthecurrentbarisflat

i_MarketPositionwillreturnavalueof1ifthepositiononthecurrentbarislong

i_MarketPositionwillreturnavalueof-1ifthepositiononthecurrentbarisshort

739

Page 740: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_OpenEquityReturnsthecurrentequity(netprofit+openpositionprofit)

Usage

i_OpenEquity

Notes

Thisfunctioncanonlybeusedinindicators.

Example

i_OpenEquitywillreturn100ifthecurrentequityis100.

i_OpenEquitywillreturn-100ifthecurrentequityis-100.

740

Page 741: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LargestLosTradeReturnsanegativenumericalvalue,indicatingthecurrencyvalueofthelargestcompletedlosingtrade.

Usage

LargestLosTrade

Notes

Thisfunctioncanonlybeusedinsignals.

Example

LargestLosTradewillreturnavalueof-20iftherewereatotaloffourlosingtradesat10,5,20,and15

LargestLosTradewillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

741

Page 742: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LargestWinTradeReturnsanumericalvalue,indicatingthecurrencyvalueofthelargestcompletedwinningtrade.

Usage

LargestWinTrade

Notes

Thisfunctioncanonlybeusedinsignals.

Example

LargestWinTradewillreturnavalueof20iftherewereatotaloffourwinningtradesat10,5,20,and15

LargestWinTradewillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

742

Page 743: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxConsecLosersReturnsanumericalvalue,indicatingthenumberoftradesinthelongestsequenceofconsecutivecompletedlosingtrades.

Usage

MaxConsecLosers

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxConsecLoserswillreturnavalueof3iftherewerethreeconsecutivecompletedlosingtrades

MaxConsecLoserswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

743

Page 744: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxConsecWinnersReturnsanumericalvalue,indicatingthenumberoftradesinthelongestsequenceofconsecutivecompletedwinningtrades.

Usage

MaxConsecWinners

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxConsecWinnerswillreturnavalueof3iftherewerethreeconsecutivecompletedwinningtrades

MaxConsecWinnerswillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

744

Page 745: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContractsHeldReturnsanumericalvalue,indicatingthemaximumnumberofcontractsorsharesheldatanyonetime.

Usage

MaxContractsHeld

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxContractsHeldwillreturnavalueof10ifamaximumoftencontractswereheldatanyonetime

745

Page 746: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxIDDrawDownReturnsanegativenumericalvalue,indicatingthelargestdeclineinequityduringtheentiretradingperiod.

Usage

MaxIDDrawDown

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxIDDrawDownwillreturnavalueof-500ifthelargestdeclineinequityduringtheentiretradingperiodwas¤500

746

Page 747: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxSharesHeldSameasMaxContractsHeld

747

Page 748: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NetProfitReturnsanumericalvalue,indicatingthetotalcurrencyvalueofallcompletedtrades.

Usage

NetProfit

Notes

Thisfunctioncanonlybeusedinsignals.

Example

NetProfitwillreturnavalueof20iftherewerewinningtradesat25and10,andlosingtradesat5and10

NetProfitwillreturnavalueof-15iftherewerewinningtradesat10and5,andlosingtradesat20and10

NetProfitwillreturnavalueof0notradeswerecompletedduringtheentiretradingperiod

748

Page 749: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumEvenTradesReturnsanumericalvalue,indicatingthetotalnumberofallcompletedeventrades.

Usage

NumEvenTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

NumEvenTradeswillreturnavalueof10ifthereweretencompletedeventrades

NumEvenTradeswillreturnavalueof0ifnoeventradeswerecompletedduringtheentiretradingperiod

749

Page 750: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumLosTradesReturnsanumericalvalue,indicatingthenumberofallcompletedlosingtrades.

Usage

NumLosTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

NumLosTradeswillreturnavalueof5iftherewereatotaloffivecompletedlosingtrades

NumLosTradeswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

750

Page 751: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumWinTradesReturnsanumericalvalue,indicatingthenumberofallcompletedwinningtrades.

Usage

NumWinTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

NumWinTradeswillreturnavalueof5iftherewereatotaloffivecompletedwinningtrades

NumWinTradeswillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

751

Page 752: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PercentProfitReturnsanumericalvalue,indicatingthepercentageofwinningtradesinalltradescompleted.

Usage

PercentProfit

Notes

Thisfunctioncanonlybeusedinsignals.

Example

PercentProfitwillreturnavalueof70ifsevenoutofthetotalof10completedtradeswerewinningtrades

752

Page 753: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetCustomFitnessValue

Setsavalueofthecustomcriterionthatistobeusedforoptimization.

Usage

SetCustomFitnessValue(Criterion)

Where:Criterion-anexpressionspecifyingacustomcriterionvalue.

Note

ThisfunctioncanbeusedonlyinsignalsTousethecustomfitnessvalue:1. Opengeneticalgorithmpropertieswindow;2. Setthenumberofsimulationsbychangingtheinputsrange;3. SelecttheAlgorithm-SpecifiedPropertiestab;4. SelecttheCustomFitnessValuefromthelistundertheStandard

Criteriasection.

Example

Setthegrossprofittobeacustomcriterionforgeneticoptimization

SetCustomFitnessValue(GrossProfit);

Settheformulatobeacustomcriterionforgeneticoptimization

SetCustomFitnessValue(TotalTrades/(GrossLoss+GrossProfit));

753

Page 754: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TotalBarsEvenTradesReturnsanumericalvalue,indicatingthetotalnumberofbarsapositionwasheldduringallcompletedeventrades.

Usage

TotalBarsEvenTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

TotalBarsEvenTradeswillreturnavalueof14iffoureventradesheldpositionsfor2,5,3,and4bars

TotalBarsEvenTradeswillreturnavalueof0ifnoeventradeswerecompletedduringtheentiretradingperiod

754

Page 755: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TotalBarsLosTradesReturnsanumericalvalue,indicatingthetotalnumberofbarsapositionwasheldduringallcompletedlosingtrades.

Usage

TotalBarsLosTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

TotalBarsLosTradeswillreturnavalueof14iffourlosingtradesheldpositionsfor2,5,3,and4bars

TotalBarsLosTradeswillreturnavalueof0ifnolosingtradeswerecompletedduringtheentiretradingperiod

755

Page 756: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TotalBarsWinTradesReturnsanumericalvalue,indicatingthetotalnumberofbarsapositionwasheldduringallcompletedwinningtrades.

Usage

TotalBarsWinTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

TotalBarsWinTradeswillreturnavalueof14iffourwinningtradesheldpositionsfor2,5,3,and4bars

TotalBarsWinTradeswillreturnavalueof0ifnowinningtradeswerecompletedduringtheentiretradingperiod

756

Page 757: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TotalTradesReturnsanumericalvalue,indicatingthetotalnumberofallcompletedtrades.

Usage

TotalTrades

Notes

Thisfunctioncanonlybeusedinsignals.

Example

TotalTradeswillreturnavalueof5iftherewereatotaloffivecompletedtrades

TotalTradeswillreturnavalueof0ifnotradeswerecompletedduringtheentiretradingperiod

757

Page 758: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSinceEntry

Returnsanumericalvalue,indicatingthenumberofbarssincetheinitialentryintothespecifiedposition.

Usage

BarsSinceEntry(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthenumberofbarssincethecurrentpositionhasbeenentered,toValue1variable:

Value1=BarsSinceEntry;

Assignavalue,indicatingthenumberofbarssincethemostrecentlyclosedpositionhasbeenentered,toValue1variable:

Value1=BarsSinceEntry(1);

758

Page 759: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSinceEntry_Checked

Returnsanumericalvalue,indicatingthenumberofbarssincetheinitialentryintothespecifiedposition.

Usage

BarsSinceEntry_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,BarsSinceEntry_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthenumberofbarssincethecurrentpositionhasbeenentered,toValue1variable:

Value1=BarsSinceEntry_Checked;

Assignavalue,indicatingthenumberofbarssincethemostrecentlyclosedpositionhasbeenentered,toValue1variable:

Value1=BarsSinceEntry_Checked(1);

759

Page 760: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSinceExit

Returnsanumericalvalue,indicatingthenumberofbarssinceacompleteexitfromthespecifiedposition.

Usage

BarsSinceExit(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthenumberofbarssincethelastpositionhasbeenclosed,toValue1variable:

Value1=BarsSinceExit(1);

760

Page 761: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

BarsSinceExit_Checked

Returnsanumericalvalue,indicatingthenumberofbarssinceacompleteexitfromthespecifiedposition.

Usage

BarsSinceExit_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,BarsSinceExit_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthenumberofbarssincethelastpositionhasbeenclosed,toValue1variable:

Value1=BarsSinceExit_Checked(1);

761

Page 762: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ContractProfit

Returnsanumericalvalue,indicatingthecurrentprofitorlosspereachcontractorshareofamulti-shareormulti-contractposition.

Usage

ContractProfit

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthecurrentprofitorlosspercontractorshare,toValue1variable:

Value1=ContractProfit;

762

Page 763: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentContracts

Returnsanabsolutenumericalvalue,indicatingthenumberofcontractsorsharesheldinthecurrentposition.

Usage

CurrentContracts

Notes

Thisfunctioncanonlybeusedinsignals.

Example

CurrentContractswillreturnavalueof1for1contractlong

CurrentContractswillreturnavalueof5for5sharesshort

763

Page 764: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentEntries

Returnsanumericalvalue,indicatingthenumberofopenentriesforthecurrentposition.

Usage

CurrentEntries

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthenumberofopenentriesinthecurrentposition,toValue1variable:

Value1=CurrentEntries;

764

Page 765: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CurrentSharesSameasCurrentContracts

765

Page 766: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryDate

Returnsanumericalvalue,indicatingthedateofinitialentryintothespecifiedposition.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

EntryDate(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthedatethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryDate;

Value1willequalto1081030fortheentrydateofOctober30th,2008

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeenentered,toValue1variable:

Value1=EntryDate(1);

766

Page 767: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1willequalto990402fortheentrydateofApril2nd,1999

767

Page 768: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryDateTime

Returnsadouble-precisiondecimalDateTimevalueindicatingthedateandtimeofthebarwheretheorderthatopenedaspecifiedpositionwasgenerated.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

EntryDateTime(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthedatethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryDateTime;

768

Page 769: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryDateTime_Checked

Returnsadouble-precisiondecimalDateTimevalueindicatingthedateandtimeofthebarwheretheorderthatopenedaspecifiedpositionwasgenerated.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

EntryDateTime_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

IfPosBackvalueisgreaterthattherealnumberofpreviouslyopenedpositions,EntryDateTime_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthedatethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryDateTime_Checked;

769

Page 770: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryDate_Checked

Returnsanumericalvalue,indicatingthedateofinitialentryintothespecifiedposition.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

EntryDate_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,EntryDate_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthedatethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryDate_Checked;

Value1willequalto1081030fortheentrydateofOctober30th,2008

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeen

770

Page 771: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

entered,toValue1variable:

Value1=EntryDate_Checked(1);

Value1willequalto990402fortheentrydateofApril2nd,1999

771

Page 772: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryName

Returnsthenameoftheorderwhichopenedtheposition.

Usage

EntryName(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

Notes

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Example

EntryName(1)willreturnavalueof"buyLE"forthelastclosedposition,ifthispositionwasopenedbytheorderwith"buyLE"name.

772

Page 773: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryPrice

Returnsanumericalvalue,indicatingthepriceattheinitialentryintothespecifiedposition.

Usage

EntryPrice(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingtheentrypriceforthecurrentposition,toValue1variable:

Value1=EntryPrice;Assignavalue,indicatingtheentrypriceforthemostrecentlyclosedposition,toValue1variable:

Value1=EntryPrice(1);

773

Page 774: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryPrice_Checked

Returnsanumericalvalue,indicatingthepriceattheinitialentryintothespecifiedposition.

Usage

EntryPrice_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,EntryPrice_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingtheentrypriceforthecurrentposition,toValue1variable:

Value1=EntryPrice_Checked;

Assignavalue,indicatingtheentrypriceforthemostrecentlyclosedposition,toValue1variable:

Value1=EntryPrice_Checked(1);

774

Page 775: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryTime

Returnsanumericalvalue,indicatingthetimeofinitialentryintothespecifiedposition.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

EntryTime(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthetimethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryTime;

Value1willequalto1015for10:15AM

Assignavalue,indicatingthetimethatthemostrecentlyclosedpositionhasbeenentered,toValue1variable:

Value1=EntryTime(1);

Value1willequalto1545for3:45PM

775

Page 776: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

776

Page 777: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

EntryTime_Checked

Returnsanumericalvalue,indicatingthetimeofinitialentryintothespecifiedposition.

Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

EntryTime_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,EntryTime_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthetimethatthecurrentpositionhasbeenentered,toValue1variable:

Value1=EntryTime_Checked;

Value1willequalto1015for10:15AM.

Assignavalue,indicatingthetimethatthemostrecentlyclosedpositionhasbeenentered,toValue1variable:

777

Page 778: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=EntryTime_Checked(1);

Value1willequalto1015for10:15AM.

778

Page 779: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitDate

Returnsanumericalvalue,indicatingthedateofthecompleteexitfromthespecifiedposition.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

ExitDate(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitDate(1);

Value1willequalto1081030fortheexitdateofOctober30th,2008

779

Page 780: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitDateTime

Returnsadouble-precisiondecimalDateTimevalueindicatingthedateandtimeofthebarwheretheorderthatclosedaspecifiedpositionwasgenerated.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

ExitDateTime(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitDateTime(1);

780

Page 781: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitDateTime_Checked

Returnsadouble-precisiondecimalDateTimevalueindicatingthedateandtimeofthebarwheretheorderthatclosedaspecifiedpositionwasgenerated.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

ExitDateTime_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

IfPosBackvalueisgreaterthattherealnumberofpreviouslyopenedpositions,ExitDateTime_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitDateTime_Checked(1);

781

Page 782: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitDate_Checked

Returnsanumericalvalue,indicatingthedateofthecompleteexitfromthespecifiedposition.ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

ExitDate_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,ExitDate_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthedatethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitDate_Checked(1);

Value1willequalto1081030fortheexitdateofOctober30th,2008.

782

Page 783: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitName

Returnsthenameoftheorderwhichclosedtheposition.

Usage

ExitName(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

Notes

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Example

ExitName(1)willreturnavalueof"sellLX"forthelastclosedposition,ifthispositionwasclosedbytheorderwith"sellLX"name.

783

Page 784: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitPrice

Returnsanumericalvalue,indicatingthepriceatacompleteexitfromthespecifiedposition.

Usage

ExitPrice(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingtheexitpriceofthemostrecentlyclosedposition,toValue1variable:

Value1=ExitPrice(1);

784

Page 785: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitPrice_Checked

Returnsanumericalvalue,indicatingthepriceatacompleteexitfromthespecifiedposition.

Usage

ExitPrice_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,ExitPrice_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingtheexitpriceofthemostrecentlyclosedposition,toValue1variable:

Value1=ExitPrice_Checked(1);

785

Page 786: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitTime

Returnsanumericalvalue,indicatingthetimeatthecompleteexitfromthespecifiedposition.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

ExitTime(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-thelastpositionclosed(onepositionback);2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthetimethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitTime(1);

Value1willequalto1545for3:45PM

786

Page 787: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ExitTime_Checked

Returnsanumericalvalue,indicatingthetimeatthecompleteexitfromthespecifiedposition.Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

ExitTime_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,ExitTime_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthetimethatthemostrecentlyclosedpositionhasbeenexited,toValue1variable:

Value1=ExitTime_Checked(1);

Value1willequalto1545for3:45PM.

787

Page 788: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_MarketPosition_at_BrokerReturnsanumericalvalue,indicatingthenumberofcontractsandthetypeofpositionatthebrokerforthesymbol.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

i_MarketPosition_at_Broker

Notes

Thisfunctioncanonlybeusedinindicators.

Thisfunctiondiffersfromthemarketpositionkeywordinthatitcannottakeanargumenttoreferencepastvalues.Bysavingthevalueofi_MarketPosition_at_BrokertoaNumericVariable,it'spossibletoreferencethepositionatthebrokerforpreviousbarsortick.

I_MarketPosition_at_Brokerworkswithallbrokers,thoughtherearesomepeculiaritieswithMIGBankandTradingTechnologies:ForMIGBank,MultiChartscalculatesthebrokerpositionafterthebrokerprofilehasbeenconnectedsincethisisn'tprovidedbyMIGBank.TheTradingTechnologiesAPIdoesn'tprovideinformationaboutpositionsopenedthedaybefore,inwhichcaseMultiChartsusestheaverageofallcompletelong(short)tradesforthedaytocalculatetheEntryPrice.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

788

Page 789: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

i_MarketPosition_at_Brokerwillwillreturn'17'ifthecurrentpositionatthebrokerforthestrategyis17contractslong.

i_MarketPosition_at_Brokerwillreturn'-132'ifthecurrentpositionatthebrokerforthestrategyis132contractsshort.

i_MarketPosition_at_Brokerwillreturn'0'ifthecurrentpositionatthebrokerforthestrategyisflat.

i_MarketPosition_at_Brokerwillreturn'0'iftheAutomatedTradingModeisnotturnedon.

789

Page 790: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_MarketPosition_at_Broker_for_The_StrategyReturnsanumericalvalue,indicatingthenumberofcontractsandthetypeofpositionatthebrokerforthestrategy.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

i_MarketPosition_at_Broker_for_The_Strategy

Notes

Thisfunctioncanonlybeusedinindicators.

Thisfunctiondiffersfromthemarketpositionkeywordinthatitcannottakeanargumenttoreferencepastvalues.Bysavingthevalueofi_MarketPosition_at_Broker_for_The_StrategytoaNumericVariable,it'spossibletoreferencethepositionatthebrokerforpreviousbarsortick.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

Example

i_MarketPosition_at_Broker_for_The_Strategywillwillreturn'17'ifthecurrentpositionatthebrokerforthestrategyis17contractslong.

i_MarketPosition_at_Broker_for_The_Strategywillreturn'-132'ifthecurrentpositionatthebrokerforthestrategyis132contractsshort.

790

Page 791: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

i_MarketPosition_at_Broker_for_The_Strategywillreturn'0'ifthecurrentpositionatthebrokerforthestrategyisflat.

i_MarketPosition_at_Broker_for_The_Strategywillreturn'0'iftheAutomatedTradingModeisnotturnedon.

791

Page 792: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketPosition

Returnsanumericalvalue,indicatingthetypeofthespecifiedposition.

Avalueof1indicatesalongposition,-1indicatesashortposition,and0isreturnedonlyifthecurrentpositionisspecifiedandindicatesthatthecurrentpositionisflat.

Usage

MarketPosition(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MarketPositionwillreturnavalueof0ifthecurrentpositionisflat

MarketPosition(1)willreturnavalueof-1ifthemostrecentlyclosedpositionwasashortposition

792

Page 793: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketPosition_at_BrokerReturnsanumericalvalue,indicatingthenumberofcontractsandthetypeofpositionatthebrokerforthesymbol.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

MarketPosition_at_Broker

Notes

Thisfunctioncanonlybeusedinsignalsandfunctions.

Thisfunctiondiffersfromthemarketpositionkeywordinthatitcannottakeanargumenttoreferencepastvalues.

ThisfunctioncanonlybeusedwithInteractiveBrokers,Patsystems,andZen-Fire.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

Example

MarketPosition_at_Brokerwillwillreturn'17'ifthecurrentpositionatthebrokerforthestrategyis17contractslong.

MarketPosition_at_Brokerwillreturn'-132'ifthecurrentpositionatthebrokerforthestrategyis132contractsshort.

793

Page 794: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketPosition_at_Brokerwillreturn'0'ifthecurrentpositionatthebrokerforthestrategyisflat.

MarketPosition_at_Brokerwillreturn'0'iftheAutomatedTradingModeisnotturnedon.

794

Page 795: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketPosition_at_Broker_for_The_StrategyReturnsanumericalvalue,indicatingthenumberofcontractsandthetypeofpositionatthebrokerforthestrategy.

Apositivevalueindicatesalongpositionandanegativevalueindicatesashortposition.

Azero('0')isreturnedwhenthecurrentpositionisflat,orifAutomatedTradingisnotturnedon.

Usage

MarketPosition_at_Broker_for_The_Strategy

Notes

Thisfunctioncanonlybeusedinsignalsandfunctions.

Thisfunctiondiffersfromthemarketpositionkeywordinthatitcannottakeanargumenttoreferencepastvalues.

Important

IfAutomatedTradingwasmanuallyturnedoffbytheuser,thevaluereturnedbythekeywordstopschanging,andmayremainunequalto'0'.

Example

MarketPosition_at_Broker_for_The_Strategywillwillreturn'17'ifthecurrentpositionatthebrokerforthestrategyis17contractslong.

MarketPosition_at_Broker_for_The_Strategywillreturn'-132'ifthecurrentpositionatthebrokerforthestrategyis132contractsshort.

MarketPosition_at_Broker_for_The_Strategywillreturn'0'ifthecurrent

795

Page 796: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

positionatthebrokerforthestrategyisflat.

MarketPosition_at_Broker_for_The_Strategywillreturn'0'iftheAutomatedTradingModeisnotturnedon.

796

Page 797: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarketPosition_Checked

Returnsanumericalvalue,indicatingthetypeofthespecifiedposition.

Avalueof1indicatesalongposition,-1indicatesashortposition,and0isreturnedonlyifthecurrentpositionisspecifiedandindicatesthatthecurrentpositionisflat.

Usage

MarketPosition_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MarketPosition_Checkedwillgenerateanerror.

Example

MarketPosition_Checked-willreturnavalueof0ifthecurrentpositionisflat.

MarketPosition_Checked(1)-willreturnavalueof-1ifthemostrecentlyclosedpositionwasashortposition.

797

Page 798: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContractProfit

Returnsanumericalvalue,indicatingthelargestgainreachedpereachcontractorshareofacurrentmulti-shareormulti-contractposition.

Usage

MaxContractProfit

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Assignavalue,indicatingthelargestgainreachedpercontractorshare,toValue1variable:

Value1=MaxContractProfit;

798

Page 799: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContractProfit_Checked

Returnsanumericalvalue,indicatingthelargestgainreachedpereachcontractorshareofacurrentmulti-shareormulti-contractposition.

Usage

MaxContractProfit_Checked

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MaxContractProfit_Checkedwillgenerateanerror.

Example

Assignavalue,indicatingthelargestgainreachedpercontractorshare,toValue1variable:

Value1=MaxContractProfit_Checked

799

Page 800: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContracts

Returnsanabsolutenumericalvalue,indicatingthemaximumnumberofcontractsheldduringthespecifiedposition.

Usage

MaxContracts(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxContractswillreturnavalueof0ifthecurrentpositionisflat

MaxContracts(1)willreturnavalueof10ifthemostrecentlyclosedpositionwaslongorshortamaximumof10contracts

800

Page 801: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxContracts_Checked

Returnsanabsolutenumericalvalue,indicatingthemaximumnumberofcontractsheldduringthespecifiedposition.

Usage

MaxContracts_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MaxContracts_Checkedwillgenerateanerror.

Example

MaxContracts_Checked-willreturnavalueof0ifthecurrentpositionisflat.

MaxContracts_Checked(1)-willreturnavalueof10ifthemostrecentlyclosedpositionwaslongorshortamaximumof10contracts.

801

Page 802: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxEntries

Returnsanumericalvalue,indicatingthetotalnumberofentriesforthespecifiedposition.

Usage

MaxEntries(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxEntries(1)willreturnavalueof2ifthereweretwoseparateentriesforthemostrecentlyclosedposition

802

Page 803: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxEntries_Checked

Returnsanumericalvalue,indicatingthetotalnumberofentriesforthespecifiedposition.

Usage

MaxEntries_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MaxEntries_Checkedwillgenerateanerror.

Example

MaxEntries_Checked(1)-willreturnavalueof2ifthereweretwoseparateentriesforthemostrecentlyclosedposition.

803

Page 804: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxPositionLoss

Returnsanegativenumericalvalue,indicatingthelargestlossreachedwhilethespecifiedpositionwasheld.

Usage

MaxPositionLoss(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxPositionLosswillreturnavalueof0ifthevalueoftheopenpositionhasnotdroppedbelowtheentrypriceatanytimewhileitwasheld

MaxPositionLoss(1)willreturnavalueof-10ifthemostrecentlyclosedpositionhasdroppedinvalueasmuchas¤10whileitwasheld

804

Page 805: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxPositionLoss_Checked

Returnsanegativenumericalvalue,indicatingthelargestlossreachedwhilethespecifiedpositionwasheld.

Usage

MaxPositionLoss_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MaxPositionLoss_Checkedwillgenerateanerror.

Example

MaxPositionLoss_Checked;-willreturnavalueof0ifthevalueoftheopenpositionhasnotdroppedbelowtheentrypriceatanytimewhileitwasheld.

MaxPositionLoss_Checked(1);-willreturnavalueof-10ifthemostrecentlyclosedpositionhasdroppedinvalueasmuchas¤10whileitwasheld.

805

Page 806: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxPositionProfit

Returnsanumericalvalue,indicatingthelargestgainreachedwhilethespecifiedpositionwasheld.

Usage

MaxPositionProfit(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

MaxPositionProfitwillreturnavalueof0ifthevalueoftheopenpositionhasnotincreasedatanytimewhileitwasheld

MaxPositionProfit(1)willreturnavalueof10ifthemostrecentlyclosedpositionhasgainedinvalueasmuchas¤10whileitwasheld

806

Page 807: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxPositionProfit_Checked

Returnsanumericalvalue,indicatingthelargestgainreachedwhilethespecifiedpositionwasheld.

Usage

MaxPositionProfit_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,MaxPositionProfit_Checkedwillgenerateanerror.

Example

MaxPositionProfit_Checked;-willreturnavalueof0ifthevalueoftheopenpositionhasnotincreasedatanytimewhileitwasheld.

MaxPositionProfit_Checked(1);-willreturnavalueof10ifthemostrecentlyclosedpositionhasgainedinvalueasmuchas¤10whileitwasheld.

807

Page 808: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxPositionsAgo

Returnsthenumberofclosedpositionsforthestrategyonthecurrentmoment.

Usage

MaxPositionsAgo

Note

ThisfunctioncanonlybeusedinSignals.

Example

CalculatethePnLforallclosedpositionsuptothecurrentmoment:

var:TotalProfitLoss(0),idx(0);foridx=1toMaxPositionsAgoBeginTotalProfitLoss=PositionProfit(idx);End;

808

Page 809: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxSharesSameasMaxContracts

809

Page 810: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MaxShares_CheckedSameasMaxContracts_Checked

810

Page 811: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenPositionProfit

Returnsanumericalvalue,indicatingthecurrentunrealizedprofitorlossfortheopenposition.

Usage

OpenPositionProfit

Notes

Thisfunctioncanonlybeusedinsignals.

Example

OpenPositionProfitwillreturnavalueof0ifthecurrentpositionisflat

OpenPositionProfitwillreturnavalueof10ifthevalueoftheopenpositionhasincreasedby¤10sinceitwasentered

OpenPositionProfitwillreturnavalueof-5ifthevalueoftheopenpositionhasdecreasedby¤5sinceitwasentered

811

Page 812: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PositionProfit

Returnsanumericalvalue,indicatingthetotalrealizedprofitorlossforthespecifiedclosedposition.

Usage

PositionProfit(PosBack)

Where:PosBack-anumericalexpression,specifyingtheclosedposition:

1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

Thisfunctioncanonlybeusedinsignals.

Example

PositionProfit(0)willreturnavalueof5ifthevalueoftheopenpositionhasincreasedby¤5sinceitwasentered

PositionProfit(1)willreturnavalueof-5ifthemostrecentlyclosedpositionhasgeneratedalossof¤5

812

Page 813: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PositionProfit_Checked

Returnsanumericalvalue,indicatingtheprofitorlossforthespecifiedposition.

Usage

PositionProfit_Checked(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;1-onepositionback(thelastpositionclosed);2-twopositionsback,etc.

IfPosBackisnotspecified,avaluefortheopenpositionwillbereturned.

Notes

1. Thisfunctioncanonlybeusedinsignals.2. IfPosBackvalueisgreaterthattherealnumberofpreviouslyopened

positions,PositionProfit_Checkedwillgenerateanerror.

Example

PositionProfit_Checked;-willreturnavalueof0ifthecurrentpositionisflat.

PositionProfit_Checked(0);-willreturnavalueof5ifthevalueoftheopenpositionhasincreasedby¤5sinceitwasentered.

PositionProfit_Checked(1);-willreturnavalueof-5ifthemostrecentlyclosedpositionhasgeneratedalossof¤5.

813

Page 814: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

ChangeMarketPosition

Placestheorderwithsetnameandpriceonthechart.

Usage

ChangeMarketPosition(Delta,Price,Name)

Where:Delta-numberofcontractsbywhichcurrentmarketpositionshouldbechanged;Price-orderfillingprice;Name-nameoftheorderthatchangestheposition.

Notes

Canbeusedasameanofsynchronizationofstrategymarketpositionwithabroker.

Example

IfMarketPosition=2thenChangeMarketPosition(-2,100,"LX")

Willplacecloseorderwiththename"LX"andtheprice100ifcurrentmarketposition=2

IfMarketPosition=0thenChangeMarketPosition(-2,100,"SE")

Willplaceopenorderwiththename"SE"andtheprice100ifcurrentmarketposition=0

Pleasereferto"!FromStrategyToBrokerMPSynchronizer!"defaultsignalformoreexamples.

814

Page 815: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PlaceMarketOrder

Placesmarketorderatthebrokerwithoutpositionchangingonthechart.

Usage

PlaceMarketOrder(IsBuy,IsEntry,Contracts)

Where:IsBuy-indicateswhetherorderisbuyorsell;IsEntry-indicateswhetherorderisentryorexit;Contracts-indicatesthenumberofcontracts/sharesoftheorder.

Notes

Worksonlywithautotradingturnedon.

Canbeusedasameanofsynchronizationofstrategymarketpositionwithabroker.

Example

IfMarketPosition*CurrentContracts=2andMarketPosition_at_Broker=4thenPlaceMarketOrder(false,false,2);

willgeneratesellmarketorderfor2contractstosynchronizemarketpositionatbrokerwiththestrategyposition

Pleasereferto"!FromStrategyToBrokerMPSynchronizer!"defaultsignalformoreexamples.

815

Page 816: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntriesCount

SameasCurrentEntries.

816

Page 817: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryComission

Returnsanumericalvalue,indicatingtheamountofcashassetsintheunitsoftheselectedcurrencyspentonthecommissionforspecifiedtrade.

Usage

OpenEntryComission(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryComission(1)willreturnavalueof1iftherehasbeenoneunitoftheselectedcurrencycomissionforthesecondtradeoftheopenposition.

817

Page 818: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryContracts

Returnsanumericalvalue,indicatingthequantityofcontractsofspecifiedentryorderintotheopenposition.

Usage

OpenEntryContracts(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryContractswillreturnavalueof1forthefirsttradeofthe3contractsopenpositionifithastwoopentradesfor1and2contracts.

OpenEntryContracts(1)willreturnavalueof2forthesecondtradeofthe3contractsopenpositionifithastwoopentradesfor1and2contracts.

818

Page 819: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryDate

Returnsanumericalvalue,indicatingthedateofspecifiedentryintotheopenposition.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

OpenEntryDate(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryDate(1)willreturn1110402fortheopenpositionifthesecondtradewasgeneratedonApril2nd,2011.

819

Page 820: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryMaxProfit

Returnsanumericalvalue,indicatingmaximalvalueofOpenEntryProfitforthetimefromentryorderexecution.

Usage

OpenEntryMaxProfit(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryMaxProfitwillreturnavalueof20forthefirsttradeoftheopenpositionifithaseverreached20unitsofthespecifiedcurrencymaximumprofit.

820

Page 821: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryMaxProfitPerContract

Returnsanumericalvalue,indicatingmaximalvalueofOpenEntryProfitPerContractforthetimefromentryorderexecution.

Usage

OpenEntryMaxProfitPerContract(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryMaxProfitPerContract(1)willreturnavalueof1.5forthefirsttradeoftheopenpositionifithaseverreached1.5unitsofthespecifiedcurrencypercontractprofit.

821

Page 822: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryMinProfit

Returnsanumericalvalue,indicatingminimalvalueofOpenEntryProfitforthetimefromentryorderexecution.

Usage

OpenEntryMinProfit(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryMinProfit(1)willreturnavalueof-15forthesecondtradeoftheopenpositionifithaseverreached15unitsofthespecifiedcurrencyloss.

822

Page 823: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryMinProfitPerContract

Returnsanumericalvalue,indicatingminimalvalueofOpenEntryProfitPerContractforthetimefromentryorderexecution.

Usage

OpenEntryMinProfitPerContract(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryMinProfitPerContract(1)willreturnavalueof-1.5forthesecondtradeoftheopenpositionifithaseverreached1.5unitsofthespecifiedcurrencypercontractloss.

823

Page 824: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryPrice

Returnsanumericalvalue,indicatingthepriceofspecifiedentryintotheopenposition.

Usage

OpenEntryPrice(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryPricewillreturnavalueof101forthefirsttradeoftheopenpositionifitwasexecutedat101pricelevel.

OpenEntryPrice(1)willreturnavalueof101.5forthesecondtradeoftheopenpositionifitwasexecutedat101.5pricelevel.

824

Page 825: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryProfit

Returnsanumericalvalue,indicatingtheprofit(lossifnegative)ofspecifiedentryintotheopenpositioninthespecifiedcurrency.

Usage

OpenEntryProfit(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryProfitwillreturnavalueof10forthefirsttradeoftheopenpositionifithas10unitsofthespecifiedcurrencyprofitatthemoment.

OpenEntryProfit(1)willreturnavalueof-10forthesecondtradeoftheopenpositionifithasreached10unitsofthespecifiedcurrencylossatthemoment.

825

Page 826: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryProfitPerContract

Returnsanumericalvalue,indicatingtheprofit(lossifnegative)percontractofspecifiedentryinthespecifiedcurrency.

Usage

OpenEntryProfitPerContract(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryProfitPerContractwillreturnavalueof1forthefirsttradeoftheopenpositionifithas1unitoftheselectedcurrencypercontractprofitatthemoment.

OpenEntryProfitPerContract(1)willreturnavalueof-0.5forthesecondtradeoftheopenpositionifithasreached0.5unitsoftheselectedcurrencypercontractlossatthemoment.

826

Page 827: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

OpenEntryTime

Returnsanumericalvalue,indicatingthetimeofspecifiedentryintotheopenposition.

ThetimeisindicatedintheHHmmformat,whereHHisthehourin24hoursformatandmmareminutes.

Usage

OpenEntryTime(EntryIndex)

Where:EntryIndex-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinopenpositionuseOpenEntriesCount

Example

OpenEntryTimewillreturnavalueof1015forthefirsttradeoftheopenpositionifitwasexecutedat10:15AM.

OpenEntryTime(1)willreturnavalueof1545forthesecondtradeoftheopenpositionifitwasexecutedat3:45PM.

827

Page 828: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeCommission

Returnsanabsolutenumericalvalue,indicatingthecommissionamountspentforthespecifiedtrade.

Usage

PosTradeCommission(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeCommission(0,1)willreturnavalueof5forthesecondtradeoftheopenposition,ifthecommissionforthistradeis5unitsoftheselectedcurrency.

828

Page 829: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeCount

Returnsanumericalvalue,indicatingthetotalnumberofentriesforthespecifiedposition.

Usage

PosTradeCount(PosBack)

Where:PosBack-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

Notes

Thisfunctioncanonlybeusedinsignals.Pleasenotethatifthereisasingleentryandmultiplescalpingexits,eachexitwillhaveitsownentryinthiscaseandthecountwillincreaseaftereachpartialexit.

Example

PosTradeCount(1)willreturnavalueof2ifthereweretwoseparateentriesforthemostrecentlyclosedposition.

829

Page 830: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeEntryBar

Returnsanabsolutenumericalvalue,indicatingbarnumberofthetradeentryorder.

Usage

PosTradeEntryBar(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeEntryBar(0,1)willreturnavalueof25forthesecondtradeoftheopenposition,ifthistradewasopenedon25thbar.

830

Page 831: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeEntryCategory

Returnsanabsolutenumericalvalue,indicatingtradeentryordercategory.

Thefollowingtypesarepossible:

1=Stoporder(buynextbaratclose-1pointstop)2=Limitorder(buynextbaratclose+1pointlimit)3=Marketorder(buynextbarmarket)4=MarketatCloseorder(buythisbaratclose)5=MarketatOpenorder(buynextbaropen)6=Reservedforspecialorders7=Reservedforspecialorders8=StopLimitorder(buy1contractsnextbaratclose-2pointstopclose+2pointlimit)

Usage

PosTradeEntryCategory(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

831

Page 832: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

PosTradeEntryCategory(0,1)willreturnavalueof1forthesecondtradeoftheopenposition,iftheordertypewasStopOrder.

832

Page 833: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeEntryDateTime

Returnsdouble-precisiondecimalDateTimeforentryorder.AsanexampleseeComputerDateTime

Usage

PosTradeEntryDateTime(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeEntryDateTime(0,1)willreturnavalueof39448.25000000forthesecondtradeoftheopenposition,ifthistradewasopenedat6:00AMonJanuary1st,2008.

833

Page 834: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeEntryName

Returnsentryordername.EntryNameisindicatedonthechartandinOrderandPositionTrackerWindow.

Usage

PosTradeEntryName(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeEntryName(0,1)willreturnavalueof"buyLE"forthesecondtradeoftheopenposition,ifthistradewasopenedbytheorderwith"buyLE"name.

834

Page 835: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeEntryPrice

Returnsanabsolutenumericalvalue,indicatingtheexecutionpriceoftradeentryorder.

Usage

PosTradeEntryPrice(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeEntryPrice(0,1)willreturnavalueof100.2forthesecondtradeoftheopenposition,ifthistradewasopenedbytheorderfilledat100.2.

835

Page 836: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeExitBar

Returnsanabsolutenumericalvalue,indicatingbarnumberofthetradeexitorder.

Usage

PosTradeExitBar(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeExitBar(0,1)willreturnavalueof28forthesecondtradeoftheopenposition,ifthistradewasclosedon28thbar.

836

Page 837: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeExitCategory

Returnsanabsolutenumericalvalue,indicatingtradeexitordercategory.

Thefollowingtypesarepossible:

1=Stoporder(buynextbaratclose-1pointstop)2=Limitorder(buynextbaratclose+1pointlimit)3=Marketorder(buynextbarmarket)4=MarketatCloseorder(buythisbaratclose)5=MarketatOpenorder(buynextbaropen)6=Reservedforspecialorders7=Reservedforspecialorders8=StopLimitorder(buy1contractsnextbaratclose-2pointstopclose+2pointlimit)

Usage

PosTradeExitCategory(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

837

Page 838: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

PosTradeExitCategory(0,1)willreturnavalueof3forthesecondtradeoftheopenposition,iftheclosingordertypewasMarketOrder.

838

Page 839: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeExitDateTime

Returnsdouble-precisiondecimalDateTimeforexitorder.AsanexampleseeComputerDateTime

Usage

PosTradeExitDateTime(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeEntryDateTime(1,1)willreturnavalueof39448.25000000forthesecondtradeofthelastclosedposition,ifthistradewasclosedat6:00AMonJanuary1st,2008.

839

Page 840: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeExitName

Returnsexitordername.ExitNameisindicatedonthechartandinOrderandPositionTrackerWindow.

Usage

PosTradeExitName(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeExitName(0,1)willreturnavalueof"sellLX"forthesecondtradeoftheopenposition,ifthistradewasclosedbytheorderwith"sellLX"name.

840

Page 841: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeExitPrice

Returnsanabsolutenumericalvalue,indicatingtheexecutionpriceoftradeexitorder.

Usage

PosTradeExitPrice(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeExitPrice(0,1)willreturnavaluevalueof100.5forthesecondtradeoftheopenposition,ifthistradewasclosedbytheorderfilledat100.5.

841

Page 842: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeIsLong

ReturnsTruevalueifthetradewasopenedbybuyorder,otherwiseFalsevalueisreturned.

Usage

PosTradeIsLong(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeIsLong(0,1)willreturnTrueforthesecondtradeoftheopenposition,ifthistradewasopenedby"buy"order.

842

Page 843: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeIsOpen

ReturnsTruevalueifthetradeisopen,Falsevalueifthetradeisclosed.

Itmakessensetocheckthetradesoftheopenposition.

ForotherpositionsFalseisalwaysreturned.

Usage

PosTradeIsOpen(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeIsOpen(0,1)willreturnTrueforthesecondtradeoftheopenposition,ifthistradeisopened(therewasnoclosingorder).

843

Page 844: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeProfit

Returnsanabsolutenumericalvalue,indicatingtheprofit(orlossifnegative)ofthespecifiedtrade.

Usage

PosTradeProfit(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeProfit(0,1)willreturnavalueof3forthesecondtradeoftheopenposition,iftheprofitforthistradeis3unitsoftheselectedcurrency.

844

Page 845: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

PosTradeSize

Returnsanabsolutenumericalvalue,indicatingthenumberofcontractsorsharesinthespecifiedtrade.

Usage

PosTradeSize(PosAgo,TradeNumber)

Where:PosAgo-anumericalexpression,specifyingtheposition:

0-openposition;

1-onepositionback(thelastpositionclosed);

2-twopositionsback,etc.

TradeNumber-anumericalexpression,specifyingthenumberoftrade(zero-based).

Notes

Thisfunctioncanonlybeusedinsignals.

ToretrievethetotalnumberoftradesinspecifiedpositionusePosTradeCount

Example

PosTradeSize(0,1)willreturnavalueof2forthesecondtradeoftheopenposition,ifthistradehadaquantityof2.

845

Page 846: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

CommissionReturnsthecommissioncurrencyvalueenteredintheStrategyPropertieswindow.

Usage

Commission

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Commissionwillreturnavalueof10.00ifthecommissionhasbeensetto¤10

846

Page 847: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

GetStrategyNameRetainedforbackwardcompatibility.

847

Page 848: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MarginReturnsavalueinunitsoftheselectedcurrencythatindicatesthemarginvaluepercontract.

Usage

Margin

Notes

Themarginvaluemaynotbereturnedforalltypesofthesecurities.Themarginvalueisreturnedforfuturesandoptions.

Example

Margin

848

Page 849: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SlippageReturnstheslippagecurrencyvalueenteredintheStrategyPropertieswindow.

Usage

Slippage

Notes

Thisfunctioncanonlybeusedinsignals.

Example

Slippagewillreturnavalueof0.25iftheslippagehasbeensetto¤0.25

849

Page 850: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_Text_GetActiveReturnsanumericalvalueindicatingthetextIDnumberofthecurrentlyselectedtext;returnsavalueof-1ifnotextiscurrentlyselected.

Usage

MC_Text_GetActive

Example

Assignavalue,indicatingthetextIDnumberofthecurrentlyselectedtext,toValue1variable:Value1=MC_Text_GetActive;

850

Page 851: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_Anchor_to_Bars

Anchorsthecorrespondingtextdrawingtothevisiblebarindex;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

Text_Anchor_to_Bars(Text_ID,LogicalExpression)

Where:Text_IDisanumericalexpressionspecifyingthetextdrawingIDnumberLogicalExpressionisalogicalvalue;True=addoptionandFalse=removeoption

Notes

TextIDnumberisreturnedbyText_Newwhenthetextdrawingiscreated.

Example

AnchorthetextdrawingwithanIDnumberof3tothevisiblebarindex:

Value1=Text_Anchor_to_Bars(3,True);

851

Page 852: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_Delete

RemovesatextobjectwiththespecifiedIDnumberfromachart;returnsavalueof0iftheobjectwassuccessfullyremoved,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_Delete(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

RemovethetextobjectwithanIDnumberof3:

Value1=Text_Delete(3);

852

Page 853: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetActive

ReturnsanumericalvalueindicatingtheobjectIDnumberofthecurrentlyselectedtextobject;returnsavalueof-1ifnotextobjectsarecurrentlyselected.

Usage

Text_GetActive

Notes

Anobject-specificIDnumberisassignedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingtheobjectIDnumberofthecurrentlyselectedtextobject,toValue1variable:

Value1=Text_GetActive;

853

Page 854: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetAttribute

ReturnsalogicalvalueindicatingthesettingforanattributeofatextobjectwiththespecifiedIDnumber;returnsavalueofTrueiftheattributeissettoon,andavalueofFalseiftheattributeissettoofforifthespecifiedobjectIDnumberisinvalid.

Thesettingsofthefollowingattributescanbereturned:border,bold,italic,strike-out,andunderline.

Usage

Text_GetAttribute(ObjectID,Attribute)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Attribute-anumericalexpressionspecifyingtheattribute:

0-border1-bold2-italic3-strike-out4-underline

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignatrue/falsevalue,indicatingthesettingof"bold"attributeforthetextobjectwithanIDnumberof3,toBoldvariable:

Variable:Bold(False);

854

Page 855: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Bold=Text_GetAttribute(3,1);

855

Page 856: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetBarNumber

ReturnsanumericalvaluerepresentingthebarnumberofthetextobjectwithaspecifiedID;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetBarNumber(ref);

Parameters:

ref-IDofthetextobject;

Example

GetthenumberofthebarwhereatextobjectwithID=1isplaced:

Text_GetBarNumber(1);

856

Page 857: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetBGColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothebackgroundcolorofatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetBGColor(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AssignanRGBcolornumber,correspondingtothebackgroundcolorofthetextobjectwithanIDnumberof3,toValue1variable:

Value1=Text_GetBGColor(3);

Assignalegacycolorvalue,correspondingtothebackgroundcolorofthetextobjectwithanIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=Text_GetBGColor(3);

857

Page 858: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetBorder

Returnsalogicalvalue,indicatingwhetheraborderisaddedtoatextobjectwiththespecifiedIDnumber;returnsavalueofTrueiftheborderhasbeenadded,andavalueofFalseiftheborderhasnotbeenaddedorifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetBorder(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignatrue/falsevalue,indicatingwhetheraborderisaddedtothetextobjectwithanIDnumberof3,toBordervariable:

Variable:Border(False);Border=Text_GetBorder(3);

858

Page 859: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothecolorofthetextcontainedinatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetColor(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AssignanRGBcolornumber,correspondingtothecolorofthetextobjectwithanIDnumberof3,toValue1variable:

Value1=Text_GetColor(3);

Assignalegacycolorvalue,correspondingtothecolorofthetextobjectwithanIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=Text_GetColor(3);

859

Page 860: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetDate

Returnsanumericalvalue,indicatingthedateofthebaratwhichatextobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

Text_GetDate(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthedateofthebaratwhichatextobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Text_GetDate(3);

860

Page 861: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetFirst

Returnsanumericalvalue,indicatinganobjectIDnumberoftheoldest(thefirsttobeaddedtothecurrentchart)textobjectofthespecifiedorigin;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetFirst(Origin)

Parameters

Origin-anumericalexpressionspecifyingtheoriginofthetextobject:

1-addedbythecurrentstudy2-addedbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-addedbyanystudy,ordrawnmanuallybytheuser4-addedbythecurrentstudy,ordrawnmanuallybytheuser5-addedbyastudyotherthenthecurrentstudy6-addedbyanystudy7-addedmanuallybytheuser

Notes

Iftheoldest(thefirstadded)textobjectisdeleted,thenextoldest(thesecondadded)textobjectbecomestheoldest(thefirstadded)textobject.

Example

Assignavalue,indicatinganobjectIDnumberoftheoldesttextobjectaddedtothechartbythecurrentstudy,toValue1variable:

Value1=Text_GetFirst(1);

861

Page 862: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetFontName

ReturnsastringexpressioncorrespondingtothenameofthefontassignedtoatextobjectwiththespecifiedIDnumber.

Usage

Text_GetFontName(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Text_GetFontName(3)willreturnastringexpressioncorrespondingtothenameofthefontassignedtoatextobjectwiththeIDnumberof3

862

Page 863: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetHStyle

ReturnsthehorizontalplacementstyleofatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetHStyle(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Return

Horizontalplacementstyle:

0-totherightofthespecifiedbar1-totheleftofthespecifiedbar2-centeredonthespecifiedbar

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthehorizontalplacementstyleofthetextobjectwithanIDnumberof3,toValue1variable:

Value1=Text_GetHStyle(3);

863

Page 864: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetLock

Lockedtextdrawingscannotbemovedmanually.KeywordreturnsavalueofTrueforLockeddrawings,andavalueofFalseforothers.

Usage

Text_GetLock(Text_ID)

Where:Text_ID-anumericalexpressionspecifyingthetextdrawingIDnumber

Notes

AtextIDnumberisreturnedbyText_Newwhenthetextdrawingiscreated.

Example

AssignLockpropertyofthetextdrawingwithanIDnumberof3toCondition1variable:

Condition1=Text_GetLock(3);

864

Page 865: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetNext

ReturnsanIDnumberofthefirstexistingtextobjectaddedsubsequenttoatextobjectwiththespecifiedIDnumber,withbothobjectsofaspecifiedorigin;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetNext(ObjectID,Origin)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Origin-anumericalexpressionspecifyingtheoriginofthetextobjects:

1-addedbythecurrentstudy2-addedbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-addedbyanystudy,ordrawnmanuallybytheuser4-addedbythecurrentstudy,ordrawnmanuallybytheuser5-addedbyastudyotherthenthecurrentstudy6-addedbyanystudy7-addedmanuallybytheuser

Example

AssignavaluetoValue1variable,indicatinganIDnumberofthefirstexistingtextobjectaddedsubsequenttoatextobjectwiththeIDnumberof3,withbothobjectsaddedbythecurrentstudy:

Value1=Text_GetNext(3,1);

865

Page 866: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetSize

ReturnsanumericalvalueindicatingthefontsizeassignedtoatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetSize(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthefontsizeofthetextobjectwithanIDnumberof3,toValue1variable:

Value1=Text_GetSize(3);

866

Page 867: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetString

ReturnsastringexpressioncorrespondingtothetextcontainedinatextobjectwiththespecifiedIDnumber.

Usage

Text_GetString(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Text_GetString(3)willreturnastringexpressioncorrespondingtothetextcontainedinthetextobjectwithanIDnumberof3

867

Page 868: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetTime

Returnsanumericalvalue,indicatingthetimeofthebaratwhichatextobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

Text_GetTime(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichatextobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Text_GetTime(3);

868

Page 869: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetTime_DT

Returnsadouble-precisiondecimalDateTimevalueindicatingthetimeofthebaratwhichatextobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

ThetimeisindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

Text_GetTime_DT(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_New_Dtwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichatextobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Text_GetTime_DT(3);

869

Page 870: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetTime_s

Returnsanumericalvalueindicatingthetime,includingseconds,ofthebaratwhichatextobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

Text_GetTime_s(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_New_swhenthetextobjectiscreated.

Example

Assignavalue,indicatingthetimeofthebaratwhichatextobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Text_GetTime_s(3);

870

Page 871: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetValue

Returnsthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),atwhichatextobjectwiththespecifiedIDnumberhasbeenplaced;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetValue(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingthepricevalueatwhichatextobjectwiththeIDnumberof3hasbeenplaced,toValue1variable:

Value1=Text_GetValue(3);

871

Page 872: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_GetVStyle

ReturnstheverticalplacementstyleofatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_GetVStyle(ObjectID)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Return

Verticalplacementstyle:

0-belowthespecifiedpricevalue1-abovethespecifiedpricevalue2-centeredonthespecifiedpricevalue

Pricevaluerepresentstheverticalpositioncorrespondingtoavalueonthepricescaleofachart.

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignavalue,indicatingtheverticalplacementstyleofthetextobjectwithanIDnumberof3,toValue1variable:

Value1=Text_GetVStyle(3);

872

Page 873: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_Get_Anchor_to_Bars

Returnsthevalueofthe"anchortobar"optionofthetextdrawingwithaspecifiedID.

Usage

Text_Get_Anchor_to_Bars(Text_ID)

Where:Text_IDisanumericalexpressionspecifyingthetextdrawingIDnumber

Notes

TextIDnumberisreturnedbyText_Newwhenthetextdrawingiscreated.

Example

Assign"anchortobars"optionofthetextdrawingwithanIDnumberof3totheCondition1variable:

Condition1=Text_Get_Anchor_to_Bars(3);

873

Page 874: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_Lock

Lockscorrespondingtextdrawingsoitcannotbemovedmanually;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

Text_Lock(Text_ID,LogicalExpression)

Where:Text_ID-anumericalexpressionspecifyingthetextdrawingIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

AtextIDnumberisreturnedbyText_Newwhenthetextdrawingiscreated.

Example

LockthetextdrawingwithanIDnumberof3:

Value1=Text_Lock(3,True);

UnlockthetextdrawingwithanIDnumberof5:

Value1=Text_Lock(5,False);

874

Page 875: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New(BarDate,BarTime,PriceValue,"Text")

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Text-thestringexpressiontobedisplayed

Example

Place,onthechartthatthestudyisbasedon,thetext"UpT"atthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New(Date,Time,High,"UpT");

875

Page 876: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_BN

Displaysatextobjectconsistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalueonthechartthatthestudyisbasedon;returnsanobject-specificIDnumberrequiredtomodifytheobject.

Usage

Text_New_BN(BarNumber,PriceValue,"Text")

Parameters

BarNumber-Numericalexpressionspecifyingnumberofthebar(horizontalposition).

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectshouldbeplaced.

Text-thestringexpressiontobedisplayed.

Example

Onthechartthatthestudyisbasedonplacethetext"UpT"atthetopofthebariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_BN(currentbar,High,"UpT");

876

Page 877: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_Dt

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New_Dt(Bar_DateTime,PriceValue,"Text")

Parameters

Bar_DateTime-Numericalexpressionspecifyingdateandtimeofthebar(horizontalposition).TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Text-thestringexpressiontobedisplayed

Example

Place,onthechartthatthestudyisbasedon,thetext"UpT"atthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_Dt(DateTime,High,"UpT");

877

Page 878: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_s

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,onthechartthatthestudyisbasedon;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New_s(BarDate,BarTime_s,PriceValue,"Text")

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Text-thestringexpressiontobedisplayed

Example

Place,onthechartthatthestudyisbasedon,thetext"UpT"atthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_s(Date,Time_s,High,"UpT");

878

Page 879: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_self

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New_self(BarDate,BarTime,PriceValue,"Text")

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Text-thestringexpressiontobedisplayed

Example

Place,ontheSubChartcontainingthestudy,thetext"UpT"atthepointsoftheplotwheretheOpenpricehasincreasedincrementallyoverthelastthreebars:

Plot1(Close);IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_self(Date,Time,High,"UpT");

879

Page 880: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_Self_BNThesameasText_New_BN.Difference:DisplaysatextontheSubChartcontainingthestudy.

880

Page 881: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_Self_DT

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New_Self_DT(Bar_DateTime,PriceValue,"Text")

Parameters

Bar_DateTime-Numericalexpressionspecifyingdateandtimeofthebar(horizontalposition).TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Text-thestringexpressiontobedisplayed

Example

Place,onthechartthatthestudyisbasedon,thetext"UpT"atthetopofabariftheOpenpricehasincreasedincrementallyoverthelastthreebars:

IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_Self_DT(DateTime,High,"UpT");

881

Page 882: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_New_self_s

Displaysatextobject,consistingofthespecifiedstringexpressionlocatedatthespecifiedbarandspecifiedpricevalue,ontheSubChartcontainingthestudy;returnsanobject-specificIDnumber,requiredtomodifytheobject.

Usage

Text_New_self_s(BarDate,BarTime_s,PriceValue,"Text")

Parameters

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Text-thestringexpressiontobedisplayed

Example

Place,ontheSubChartcontainingthestudy,thetext"UpT"atthepointsoftheplotwheretheOpenpricehasincreasedincrementallyoverthelastthreebars:

Plot1(Close);IfOpen>Open[1]AndOpen[1]>Open[2]ThenValue1=Text_New_self_s(Date,Time_s,High,"UpT");

882

Page 883: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetAttribute

SetsanattributeofthetextinatextobjectwiththespecifiedIDnumber;returnsavalueof0iftheattributewassuccessfullyset,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thefollowingtextattributescanbeset:border,bold,italic,strike-out,andunderline.

Usage

Text_SetAttribute(ObjectID,Attribute,LogicalExpression)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

Attribute-anumericalexpressionspecifyingtheattribute:

0-border1-bold2-italic3-strike-out4-underline

LogicalExpression-alogicalvalue;True=onandFalse=off

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Settheattribute"bold"toonforthetextinatextobjectwiththeIDnumberof3:

883

Page 884: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=Text_SetAttribute(3,1,True);

884

Page 885: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetBarNumber

AssignsthespecifiedbarnumbertothetextobjectwiththespecifiedIDnumber;returnsavalueof0ifthebarnumberwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetBarNumber(ref,Barnumber)

Parameters:

ref-IDnumberofthetextobject;Barnumber-thenewbarnumberthatistobeassignedtothespecifiedobject.

Example

Assignthenewbarnumbervalueof100tothetextobjectwithID=1:

Text_SetBarNumber(1,100);

885

Page 886: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetBGColor

AssignsthespecifiedbackgroundcolortoatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetBGColor(ObjectID,BGColor)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

BGColor-anexpressionspecifyingthebackgroundcolor

ThecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AssignthecolorbluetothebackgroundofatextobjectwiththeIDnumberof3:

Value1=Text_SetBGColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothebackgroundofatextobjectwiththeIDnumberof3:

Value1=Text_SetBGColor(3,2138336);

Assignthelegacycolor4(Green)tothebackgroundofatextobjectwiththeID

886

Page 887: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

numberof3:

[LegacyColorValue=True];Value1=Text_SetBGColor(3,4);

887

Page 888: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetBorder

AddsorremovesaborderaroundthetextobjectwiththespecifiedIDnumber;returnsavalueof0iftheborderwassuccessfullyset,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Thecoloroftheborderisthesameasthecolorofthetextinthetextobject.

Usage

Text_SetBorder(ObjectID,LogicalExpression)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AddabordertothetextobjectwithanIDnumberof3:

Value1=Text_SetBorder(3,True);

RemoveaborderfromthetextobjectwithanIDnumberof3:

Value1=Text_SetBorder(3,False);

888

Page 889: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetColor

AssignsthespecifiedcolortothetextofatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetColor(ObjectID,TextColor)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

TextColor-anexpressionspecifyingthetextcolor

ThecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AssignthecolorbluetothetextofatextobjectwiththeIDnumberof3:

Value1=Text_SetColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothetextofatextobjectwiththeIDnumberof3:

Value1=Text_SetColor(3,2138336);

Assignthelegacycolor4(Green)tothetextofatextobjectwiththeIDnumberof

889

Page 890: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

3:

[LegacyColorValue=True];Value1=Text_SetColor(3,4);

890

Page 891: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetFontName

AssignsthespecifiedfonttoatextobjectwiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

AnyfontintheFontsfoldercanbeused;thefolderisaccessiblefromtheControlPanelinWindowsXPoperatingsystem.

Usage

Text_SetFontName(ObjectID,"FontName")

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberFontName-astringexpressionspecifyingthefontname

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

AssignfontVerdanatothetextobjectwiththeIDnumberof3:

Value1=Text_SetFontName(3,"Verdana");

891

Page 892: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetLocation

ModifiesthelocationofatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetLocation(ObjectID,BarDate,BarTime,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime-anumericalexpressionspecifyingthetimeofthebaratwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

MovethetextobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Text_SetLocation(3,Date,Time,High);

892

Page 893: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

893

Page 894: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetLocation_BN

ModifieslocationofatextobjectwiththespecifiedIDnumber;returnsavalueof0iflocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetLocation_BN(ObjectID,BarNumber,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber.

BarNumber-anumericalexpressionspecifyingthebarnumberatwhichtheobjectistobeplaced.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectshouldbeplaced.

Notes

Anobject-specificIDnumberisreturnedbyText_New_Dtwhenthetextobjectiscreated.

Example

MovethetextobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Text_SetLocation_BN(3,currentbar,High);

894

Page 895: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetLocation_DT

ModifiesthelocationofatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetLocation_DT(ObjectID,Bar_DateTime,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber.

Bar_DateTime-anumericalexpressionspecifyingthedateandtimeofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheDateTimeformat,wheretheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.DateTimeisafloatingpointvaluewithhighprecision.Itallowsaccessingmillisecondtimestampsofthebar.

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced.

Notes

Anobject-specificIDnumberisreturnedbyText_New_Dtwhenthetextobjectiscreated.

Example

MovethetextobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Text_SetLocation_DT(3,DateTime,High);

895

Page 896: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

896

Page 897: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetLocation_s

ModifiesthelocationofatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthelocationoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetLocation_s(ObjectID,BarDate,BarTime_s,PriceValue)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

BarDate-anumericalexpressionspecifyingthedateofthebaratwhichtheobjectistobeplaced;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

BarTime_s-anumericalexpressionspecifyingthetimeofthebar,includingseconds,atwhichtheobjectistobeplaced;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

PriceValue-anumericalexpressionspecifyingthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart),wheretheobjectistobeplaced

Notes

Anobject-specificIDnumberisreturnedbyText_New_swhenthetextobjectiscreated.

Example

MovethetextobjectwithanIDnumberof3tothetopofthecurrentbar:

Value1=Text_SetLocation_s(3,Date,Time_s,High);

897

Page 898: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

898

Page 899: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetSize

AssignsthespecifiedfontsizetothetextofatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthefontsizewassuccessfullyassigned,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetSize(ObjectID,FontSize)

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberFontSize-anumericalexpressionspecifyingthefontsize

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Assignthefontsizeof16tothetextofatextobjectwiththeIDnumberof3:

Value1=Text_SetSize(3,16);

899

Page 900: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetString

ReplaceswiththespecifiedstringexpressionthetextcontainedinatextobjectwiththespecifiedIDnumber;returnsavalueof0ifthestringexpressionwassuccessfullyreplaced,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetString(ObjectID,"Text")

Where:ObjectID-anumericalexpressionspecifyingtheobjectIDnumberText-thenewstringexpressiontobedisplayedinthetextobject

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

Example

Replacethetext,containedinatextobjectwiththeIDnumberof3,withthestringexpression"NewText":

Value1=Text_SetString(3,"NewText");

900

Page 901: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text_SetStyle

Setstheplacementstyleofatextobjectrelativetothebarandtothepricevaluespecifiedfortheobject;returnsavalueof0iftheplacementstyleoftheobjectwassuccessfullymodified,andavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

Text_SetStyle(ObjectID,HorizPl,VertPl)

Parameters

ObjectID-anumericalexpressionspecifyingtheobjectIDnumber

HorizPl-anumericalexpressionspecifyingthehorizontalplacementstyleforthetextobject:

0-totherightofthespecifiedbar1-totheleftofthespecifiedbar2-centeredonthespecifiedbar

VertPl-anumericalexpressionspecifyingtheverticalplacementstyleforthetextobject:

0-belowthespecifiedpricevalue1-abovethespecifiedpricevalue2-centeredonthespecifiedpricevalue

Pricevaluerepresentstheverticalpositioncorrespondingtoavalueonthepricescaleofachart.

Notes

Anobject-specificIDnumberisreturnedbyText_Newwhenthetextobjectiscreated.

901

Page 902: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Example

CenterthetextobjectwithanIDnumberof3onthebarandonthepricevalue,specifiedfortheobject:

Value1=Text_SetStyle(3,2,2);

902

Page 903: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

DoubleQuote

Displaysthedouble-quote(")characterinastring.

Example

ThisexampledemonstrateshowthewordHelloindoublequotescanbedisplayedonthelastbaraboveHigh:

Variable:ID(-1);IfLastBarOnChartThenID=Text_New(Date,Time,High+1Point,DoubleQuote+"Hello"+DoubleQuote);

903

Page 904: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

InStr

Returnsthepositionofaspecifiedstringexpressioninsideanotherspecifiedstringexpression.

Thepositionofthestringbeinglocatedisindicatedbythenumberofcharactersfromtheleftsideofthestringbeingevaluated.

Usage

InStr(String1,String2)

Where:String1-astringtobeevaluatedString2-astringtobelocated

Notes

Incasethesearchreturnsnoresults0isreturned

Incaseifthesoughtwordoccursmorethanonce,thefirstpositionwillbereturned

Searchiscasesensetive

Example

InStr("Fridayistheexpirationday","Friday");

willreturnavalueof1,indicatingthatthestring"Friday"beginsatposition1oftheString"Fridayistheexpirationday"

InStr("Fridayistheexpirationday","Monday");

willreturnavalueof0,indicatingthatthestring"Monday"doesnotexistintheString"Fridayistheexpirationday"

904

Page 905: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LeftStr

Returnsoneormoreleftmostcharactersfromthespecifiedstringexpression.

Usage

LeftStr(String,sSize)

Where:String-astringexpressionfromwhichthecharactersaretobetakensSize-anumericalexpressionspecifyingthenumberofcharacterstobereturned

Example

LeftStr("HelloWorld",5);willreturnastringexpression"Hello"

905

Page 906: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

LowerStr

Convertstheuppercaselettersofaspecifiedstringexpressiontoalowercase.

Usage

LowerStr("String")

Where:String-astringexpressiontobeconverted

Example

LowerStr("ReturnonAccount");willreturnastringexpression"returnonaccount"

906

Page 907: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MidStr

Returnsapart,startingfromaspecifiedpositionandofaspecifiedlength,ofaspecifiedstringexpression.

Usage

MidStr("String",Pos,Num)

Where:String-astringexpressionthespecifiedpartistobetakenfromPos-anumericalexpressionspecifyingtheposition,fromtheleftsideofthestring,ofthestartingcharacterofthepartNum-anumericalexpressionspecifyingthelength,incharacters,ofthepart

Example

MidStr("Largestwinningtrade",1,7);willreturnastringexpression"Largest"

907

Page 908: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NewLine

Startsanewlineandreturnscarriage.

Notes

Usethe"+"charactertoaddNewLinetoastringexpression.

Example

FileAppend("c:\testfile.txt","Wecanseeanewbarfor"+NumToStr(Date,0)+NewLine);

908

Page 909: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

NumToStr

Returnsaspecifiednumericalexpressionintheformofastringexpression.

Usage

NumToStr(Expression,Dec)

Where:Expression-anumericalexpressiontobeconvertedtoastringexpressionDec-anumericalexpressionspecifyingthenumberofdecimalplacesthereturnedstringexpressionistocontain

Example

NumToStr(1500.5,3);willreturnastringexpression"1500.500"

909

Page 910: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

RightStr

Returnsoneormorerightmostcharactersfromthespecifiedstringexpression.

Usage

RightStr(String,sSize)

Where:String-astringexpressionfromwhichthecharactersaretobetakensSize-anumericalexpressionspecifyingthenumberofcharacterstobereturned

Example

RightStr("HelloWorld",5);willreturnastringexpression"World"

910

Page 911: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Spaces

Returnsastringexpressionconsistingofaspecifiednumberofspaces.

Usage

Spaces(Num)

Where:Num-anumericalexpressionspecifyingthenumberofspaces

Example

Theexampleinsertstwoblankspacesbetweentheletters"a"and"b":

Print("a"+Spaces(2)+"b");

911

Page 912: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StrLen

Returnsthelength,incharacters,ofaspecifiedstringexpression.

Usage

StrLen("String")

Where:String-astringexpressiontobeevaluated

Example

StrLen("Drawdown");willreturnavalueof8

912

Page 913: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

StrToNum

Convertsaspecifiedstringexpressiontoanumericalvalue.

Usage

StrToNum("String")

Where:String-astringexpressiontobeconverted

Notes

Ifnon-numericcharactersareencounteredtherestoftheexpressionisignored.

Example

StrToNum("2500.70");willreturnavalueof2500.70

913

Page 914: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Text

Returnsthestring,formedupbythetransferredarguments.

Usage

Text(Param1,Param2,...,ParamN);

Where:Param(i)isstringexpression,numericexpressionorTrue/Falsevalue.

Example

Text_new(D,T,C,Text("BarDate/Timeis",Date:0:0,"/",Time:0:0));

914

Page 915: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

UpperStr

Convertsthelowercaselettersofaspecifiedstringexpressiontouppercase.

Usage

UpperStr("String")

Where:String-astringexpressiontobeconverted

Example

UpperStr("msft");willreturnastringexpression"MSFT"

915

Page 916: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_GetActiveReturnsanumericalvalueindicatingthetrendlineIDnumberofthecurrentlyselectedtrendline;returnsavalueof-1ifnotrendlinesarecurrentlyselected.

Usage

MC_TL_GetActive

Notes

Atrendline-specificIDnumberisassignedbyMC_TL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthetrendlineIDnumberofthecurrentlyselectedtrendline,toValue1variable:

Value1=MC_TL_GetActive;

916

Page 917: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_NewThesameasTL_New.

917

Page 918: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_New_BNThesameasTL_New_BN.

918

Page 919: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_New_DTThesameasTL_New_DT.

919

Page 920: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_New_SelfThesameasTL_New_Self.

920

Page 921: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_New_Self_BNThesameasTL_New_Self_BN.

921

Page 922: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MC_TL_New_Self_DTThesameasTL_New_Self_DT.

922

Page 923: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_Anchor_to_Bars

Anchorsthecorrespondingtrendlinedrawingtothevisiblebarindex;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_Anchor_to_Bars(TL_ID,LogicalExpression)

Where:TL_IDisanumericalexpressionspecifyingthetrendlineIDnumberLogicalExpressionisalogicalvalue;True=AddoptionandFalse=Removeoption

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

AnchorthetrendlinewithanIDnumberof3tothevisiblebarindex:

Value1=TL_Anchor_to_Bars(3,True);

923

Page 924: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_Delete

RemovesatrendlinewiththespecifiedIDnumberfromachart;returnsavalueof0ifthetrendlinewassuccessfullyremoved,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_Delete(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

RemovethetrendlinewithanIDnumberof3:

Value1=TL_Delete(3);

924

Page 925: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetActive

ThisreservedwordreturnsanumericvaluerepresentingtheIDofthecurrentlyactivetrendline.

Usage

TL_GetActive

Notes

Whenthereservedwordperformsitsoperationsuccessfully,trendlineIDisreturned.

Whenareservedwordcannotperformitsoperation,itreturnsanerrorcode.

Example

Value1=TL_GetActive;

AssignstheIDofthecurrentlyactivetrendlinetoValue1.

Value1isanynumericvariableorarray.

Trendlinereservedwordshouldbeassignedtoanumericvariableorarrayinordertodeterminewhetherthereservedwordperformeditsoperationsuccessfullyornot.

925

Page 926: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetAlert

ReturnsthealertstatusforatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetAlert(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Return

Alertstatus:

0-Alertdisabled

1-Breakoutintra-bar

AnalertistriggerediftheHighcrossesoverthetrendlineortheLowcrossesunderthetrendline.Alerttriggeringconditionsareevaluatedintra-bar.

2-Breakoutonclose

AnalertistriggerediftheCloseofthepreviousbarwasbelowthetrendlineandtheCloseofthecurrentbarisabovethetrendline,oriftheCloseofthepreviousbarwasabovethetrendlineandtheCloseofthecurrentbarisbelowthetrendline.AlerttriggeringconditionsareevaluatedatCloseofabar.

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthealertstatusforatrendlinewiththeIDnumberof3,toValue1variable:

926

Page 927: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_GetAlert(3);

927

Page 928: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBeginDate

Returnsanumericalvalue,indicatingthedateofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

TL_GetBeginDate(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthedateofthestartingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetBeginDate(3);

928

Page 929: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBeginTime

Returnsanumericalvalue,indicatingthetimeofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

TL_GetBeginTime(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthetimeofthestartingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetBeginTime(3);

929

Page 930: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBeginTime_s

Returnsanumericalvalueindicatingthetime,includingseconds,ofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

TL_GetBeginTime_s(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_swhenthetrendlineiscreated.

Example

Assignavalue,indicatingthetimeofthestartingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetBeginTime_s(3);

930

Page 931: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBeginVal

Returnsthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)ofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

Usage

TL_GetBeginVal(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthepricevalueofthestartingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetBeginVal(3);

931

Page 932: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBegin_BN

ReturnsabarnumbervalueofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetBegin_BN(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

TL_GetBegin_BN(value1);willreturn5ifTrendLinewithID=Value1startsonfifthbarofpriceseries.

932

Page 933: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetBegin_Dt

ReturnsaDateTimevalue,indicatingthedateandtimeofthestartingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetBegin_Dt(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_Dtwhenthetrendlineiscreated.

Example

TL_GetBegin_Dt(value1);willreturn41422.752623935186ifTrendLinewithID=Value1startsat08:30:00.722on5/28/2013

933

Page 934: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetColor

ReturnsanRGBcolornumberoralegacycolorvaluethatcorrespondtothecolorofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetColor(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

AssignanRGBcolornumber,correspondingtothecolorofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetColor(3);

Assignalegacycolorvalue,correspondingtothecolorofatrendlinewiththeIDnumberof3,toValue1variable:

[LegacyColorValue=True];Value1=TL_GetColor(3);

934

Page 935: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEndDate

Returnsanumericalvalue,indicatingthedateoftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

ThedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth.

Usage

TL_GetEndDate(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthedateoftheendingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetEndDate(3);

935

Page 936: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEndTime

Returnsanumericalvalue,indicatingthetimeoftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

Thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM.

Usage

TL_GetEndTime(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthetimeoftheendingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetEndTime(3);

936

Page 937: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEndTime_s

Returnsanumericalvalueindicatingthetime,includingseconds,oftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

Thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM.

Usage

TL_GetEndTime_s(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_swhenthetrendlineiscreated.

Example

Assignavalue,indicatingthetimeoftheendingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetEndTime_s(3);

937

Page 938: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEndVal

Returnsthepricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)oftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

Usage

TL_GetEndVal(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthepricevalueoftheendingpointofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetEndVal(3);

938

Page 939: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEnd_BN

ReturnsabarnumbervalueoftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetEnd_BN(TL_ID)

Where:TL_ID-numericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

TL_GetEnd_BN(value1);willreturn8ifTrendLinewithID=Value1endsoneighthbarofpriceseries.

939

Page 940: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetEnd_Dt

ReturnsaDateTimevalue,indicatingthedateandtimeoftheendingpointofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetEnd_Dt(TL_ID)

Where:TL_ID-numericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_Dtwhenthetrendlineiscreated.

Example

TL_GetEnd_Dt(value1);willreturn41422.752623935186ifTrendLinewithID=Value1endsat08:30:00.722on5/28/2013

940

Page 941: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetExtLeft

Returnsalogicalvalue,indicatingwhetherthetrendlinewiththespecifiedIDnumberisextendedtotheleft;returnsavalueofTrueifthetrendlineisextended,andavalueofFalseifthetrendlineisnotextendedorifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetExtLeft(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignatrue/falsevalue,indicatingwhetherthetrendlinewithanIDnumberof3isextendedtotheleft,toExtLvariable:

Variable:ExtL(False);ExtL=TL_GetExtLeft(3);

941

Page 942: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetExtRight

Returnsalogicalvalue,indicatingwhetherthetrendlinewiththespecifiedIDnumberisextendedtotheright;returnsavalueofTrueifthetrendlineisextended,andavalueofFalseifthetrendlineisnotextendedorifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetExtRight(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignatrue/falsevalue,indicatingwhetherthetrendlinewithanIDnumberof3isextendedtotheright,toExtRvariable:

Variable:ExtR(False);ExtR=TL_GetExtRight(3);

942

Page 943: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetFirst

Returnsanumericalvalue,indicatingthetrendlineIDnumberoftheoldest(thefirsttobedrawnonthecurrentchart)trendlineofthespecifiedorigin;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetFirst(Origin)

Parameters

Origin-anumericalexpressionspecifyingtheoriginofthetrendline:

1-drawnbythecurrentstudy2-drawnbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-drawnbyanystudy,ordrawnmanuallybytheuser4-drawnbythecurrentstudy,ordrawnmanuallybytheuser5-drawnbyastudyotherthenthecurrentstudy6-drawnbyanystudy7-drawnmanuallybytheuser

Notes

Iftheoldest(thefirsttobedrawn)trendlineisdeleted,thenextoldest(thesecondtobedrawn)trendlinebecomestheoldest(thefirstdrawn)trendline.

Example

Assignavalue,indicatingthetrendlineIDnumberoftheoldesttrendlinedrawnonthechartbythecurrentstudy,toValue1variable:

Value1=TL_GetFirst(1);

943

Page 944: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetLock

Lockedtrendlinedrawingscannotbemovedmanually.KeywordreturnsavalueofTrueforlockeddrawings,andavalueofFalseforunlocked.

Usage

TL_GetLock(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

AssignLockpropertyofthetrendlinedrawingwithanIDnumberof3toCondition1variable:

Condition1=TL_GetLock(3);

944

Page 945: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetNext

ReturnsanIDnumberofthefirstexistingtrendlinedrawnsubsequenttoatrendlinewiththespecifiedIDnumber,withbothtrendlinesofaspecifiedorigin;returnsavalueof-2ifthespecifiedobjectIDnumberisinvalid.

Usage

TL_GetNext(TL_ID,Origin)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Origin-anumericalexpressionspecifyingtheoriginofthetrendlines:

1-drawnbythecurrentstudy2-drawnbyastudyotherthenthecurrentstudy,ordrawnmanuallybytheuser3-drawnbyanystudy,ordrawnmanuallybytheuser4-drawnbythecurrentstudy,ordrawnmanuallybytheuser5-drawnbyastudyotherthenthecurrentstudy6-drawnbyanystudy7-drawnmanuallybytheuser

Example

AssignavaluetoValue1variable,indicatingtheIDnumberofthefirstexistingtrendlinedrawnsubsequenttoatrendlinewiththeIDnumberof3,withbothtrendlinesdrawnbythecurrentstudy:

Value1=TL_GetNext(3,1);

945

Page 946: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetSize

ReturnsanumericalvalueindicatingthewidthofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetSize(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthewidthofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetSize(3);

946

Page 947: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetStyle

Returnsanumericalvalue,indicatingthestyleofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_GetStyle(TL_ID)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Return

Trendlinestyles:

1 ToolSolid ______________________2 ToolDashed -------------------3 ToolDotted ............................................4 ToolDashed2 _________________5 ToolDashed3 __________________

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignavalue,indicatingthestyleofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetStyle(3);

947

Page 948: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetValue

Returnsapricevalue,atthespecifieddateandtime,ofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ifthetrendlinedoesnotextendtothespecifieddateandtime,apricevaluealongthesameslopeasthetrendlinewillbereturned.

Usage

TL_GetValue(TL_ID,Date,Time)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Date-anumericalexpressionspecifyingthedate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

Time-anumericalexpressionspecifyingthetime;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignthepricevalue,at10:00AMonJanuary17th,ofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetValue(3,1080117,1000);

948

Page 949: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetValue_BN

Returnsapricevalue,atthespecifiedbarnumber,ofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ifthetrendlinedoesnotextendtothespecifiedbar,apricevaluealongthesameslopeasthetrendlinewillbereturned.

Usage

TL_GetValue_BN(TL_ID,Barnumber)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber;

Barnumber-anumericalexpressionspecifyinganumberofabar;

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignthepricevalueatbarnumber100ofatrendlinewiththeIDnumberof3toValue1variable:

Value1=TL_GetValue_BN(3,100);

949

Page 950: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetValue_Dt

Returnsapricevalue,atthespecifieddateandtime,ofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ifthetrendlinedoesnotextendtothespecifieddateandtime,apricevaluealongthesameslopeasthetrendlinewillbereturned.

Usage

TL_GetValue_Dt(TL_ID,DT)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber.

DT-anumericalexpressionspecifyingthetrendlinestartingpointdateandtime;indicatedintheDateTimeformat.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_Dtwhenthetrendlineiscreated.

Example

TL_GetValue_Dt(value1,41422.752623935186);willreturnthepriceoftrendlinewithID=Value1at08:30:00.882of5/28/2013

950

Page 951: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_GetValue_s

Returnsapricevalue,atthespecifieddateandtime,ofatrendlinewiththespecifiedIDnumber;returnsavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ifthetrendlinedoesnotextendtothespecifieddateandtime,apricevaluealongthesameslopeasthetrendlinewillbereturned.

Usage

TL_GetValue_s(TL_ID,Date,Time_s)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

Date-anumericalexpressionspecifyingthedate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

Time_s-anumericalexpressionspecifyingthetime,includingseconds;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_swhenthetrendlineiscreated.

Example

Assignthepricevalue,at10:00:00AMonJanuary17th,ofatrendlinewiththeIDnumberof3,toValue1variable:

Value1=TL_GetValue_s(3,1080117,100000);

951

Page 952: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_Get_Anchor_to_Bars

Returnsthevalueofthe"anchortobar"optionofthetrendlinedrawingwithaspecifiedID.

Usage

TL_Get_Anchor_to_Bars(TL_ID)

Where:TL_IDisanumericalexpressionspecifyingthetrendlineIDnumber

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignthe"anchortobars"optionofthetrendlinedrawingwithanIDnumberof3totheCondition1variable:

Condition1=TL_Get_Anchor_to_Bars(3);

952

Page 953: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_Lock

Lockscorrespondingtrendlinedrawingsoitcannotbemovedmanually;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_Lock(TL_ID,LogicalExpression)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

LockthetrendlinewithanIDnumberof3:

Value1=TL_Lock(3,True);

UnlockthetrendlinewithanIDnumberof5:

Value1=TL_Lock(5,False);

953

Page 954: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New

Displaysatrendline,withthespecifiedstartingandendingpoints,onthechartthatthestudyisbasedon;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

Usage

TL_New(sDate,sTime,sPriceValue,eDate,eTime,ePriceValue)

Parameters

sDate-anumericalexpressionspecifyingthetrendlinestartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime-anumericalexpressionspecifyingthetrendlinestartingpointtime;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

sPriceValue-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

eDate-anumericalexpressionspecifyingthetrendlineendingpointdate

eTime-anumericalexpressionspecifyingthetrendlineendingpointtime

ePriceValue-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrendline,thatbeginsat9:00AMatapricevalueof1381,andendsat3:00PMatapricevalueof1337,onJanuary17th,2008,onthechartthatthestudyisbasedon:

Value1=TL_New(1080117,900,1381,1080117,1500,1337);

954

Page 955: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_BN

Displaysatrendlinewiththespecifiedstartingandendingpointsonthechartthatthestudyisbasedon;returnsatrendline-specificIDnumberrequiredtomodifythetrendline.

InsteadofseparateDateandTimevaluesorasingleDateTimevalue,barnumberofpriceseriesisused.

Usage

TL_New_BN(b_BarNumber,b_Price,e_BarNumber,e_Price);

Parameters

b_BarNumber-anumericalexpressionspecifyingthetrendlinestartingpointbarnumber.

b_Price-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart).

e_BarNumber-anumericalexpressionspecifyingthetrendlineendingpointbarnumber.

e_Price-anumericalexpressionspecifyingthetrendlineendingpointpricevalue.

Example

Displayatrendlinethatwillconnectclosepriceofthefirstbarofpriceserieswiththecurrentcloseprice.

onceValue2=close;

Value1=TL_New_BN(1,Value2,currentbar,Close);

ifValue1<>Value1[1]thentl_delete(Value1[1]);

955

Page 956: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_Dt

Displaysatrendline,withthespecifiedstartingandendingpoints,onthechartthatthestudyisbasedon;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

InsteadofseparateDateandTimevalues,asingleDateTimevalueisused.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

TL_New_Dt(b_DateTime,b_Price,e_DateTime,e_Price);

Parameters

b_DateTime-anumericalexpressionspecifyingthetrendlinestartingpointdateandtime;isindicatedintheDateTimeformat.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

b_Price-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

e_DateTime-anumericalexpressionspecifyingthetrendlineendingpointtime;thedateisindicatedintheDateTimeformat.

e_Price-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrenlinethatwillconnectacloseprice100barsbackwiththecurrentcloseprice.

Value1=TL_New_Dt(DateTime[100],Close[100],DateTime,Close);

ifValue1<>Value1[1]thentl_delete(Value1[1]);

956

Page 957: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_s

Displaysatrendline,withthespecifiedstartingandendingpoints,onthechartthatthestudyisbasedon;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

Usage

TL_New_s(sDate,sTime_s,sPriceValue,eDate,eTime_s,ePriceValue)

Parameters

sDate-anumericalexpressionspecifyingthetrendlinestartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime_s-anumericalexpressionspecifyingthetrendlinestartingpointtime,includingseconds;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

sPriceValue-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

eDate-anumericalexpressionspecifyingthetrendlineendingpointdate

eTime_s-anumericalexpressionspecifyingthetrendlineendingpointtime,includingseconds

ePriceValue-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrendline,thatbeginsat9:00:00AMatapricevalueof1381,andendsat3:00:00PMatapricevalueof1337,onJanuary17th,2008,onthechartthatthestudyisbasedon:

957

Page 958: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_New_s(1080117,90000,1381,1080117,150000,1337);

958

Page 959: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_self

Displaysatrendline,withthespecifiedstartingandendingpoints,ontheSubChartcontainingthestudy;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

Usage

TL_New_self(sDate,sTime,sPriceValue,eDate,eTime,ePriceValue)

Parameters

sDate-anumericalexpressionspecifyingthetrendlinestartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime-anumericalexpressionspecifyingthetrendlinestartingpointtime;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

sPriceValue-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

eDate-anumericalexpressionspecifyingthetrendlineendingpointdate

eTime-anumericalexpressionspecifyingthetrendlineendingpointtime

ePriceValue-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrendline,thatbeginsat9:00AMatapricevalueof1381,andendsat3:00PMatapricevalueof1337,onJanuary17th,2008,ontheSubChartcontainingthestudy:

Value1=TL_New_self(1080117,900,1381,1080117,1500,1337);

959

Page 960: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_Self_BNThesameasTL_New_BN.Difference:DisplaysatrendlineontheSubChartcontainingthestudy.

960

Page 961: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_Self_Dt

Displaysatrendline,withthespecifiedstartingandendingpoints,ontheSubChartcontainingthestudy;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

InsteadofseparateDateandTimevalues,asingleDateTimevalueisused.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

TL_New_Self_Dt(b_DateTime,b_Price,e_DateTime,e_Price);

Parameters

b_DateTime-anumericalexpressionspecifyingthetrendlinestartingpointdateandtime;isindicatedintheDateTimeformat.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

b_Price-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

e_DateTime-anumericalexpressionspecifyingthetrendlineendingpointtime;thedateisindicatedintheDateTimeformat.

e_Price-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrenlinethatwillconnectacloseprice100barsbackwiththecurrentclosepriceontheSubChartcontainingthestudy.

Value1=TL_New_Self_Dt(DateTime[100],Close[100],DateTime,Close);

ifValue1<>Value1[1]thentl_delete(Value1[1]);

961

Page 962: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_New_Self_s

Displaysatrendline,withthespecifiedstartingandendingpoints,ontheSubChartcontainingthestudy;returnsatrendline-specificIDnumber,requiredtomodifythetrendline.

Usage

TL_New_s(sDate,sTime_s,sPriceValue,eDate,eTime_s,ePriceValue)

Parameters

sDate-anumericalexpressionspecifyingthetrendlinestartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime_s-anumericalexpressionspecifyingthetrendlinestartingpointtime,includingseconds;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

sPriceValue-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

eDate-anumericalexpressionspecifyingthetrendlineendingpointdate

eTime_s-anumericalexpressionspecifyingthetrendlineendingpointtime,includingseconds

ePriceValue-anumericalexpressionspecifyingthetrendlineendingpointpricevalue

Example

Displayatrendline,thatbeginsat9:00:00AMatapricevalueof1381,andendsat3:00:00PMatapricevalueof1337,onJanuary17th,2008,ontheSubChartcontainingthestudy:

962

Page 963: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_New_s(1080117,90000,1381,1080117,150000,1337);

963

Page 964: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetAlert

SetsthealertstatusforatrendlinewiththespecifiedIDnumber;returnsavalueof0ifalertstatuswassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetAlert(TL_ID,AlertStatus)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

AlertStatus-anumericalexpressionspecifyingthealertstatusforthetrendline:

0-Alertdisabled

1-Breakoutintra-bar

AnalertistriggerediftheHighcrossesoverthetrendlineortheLowcrossesunderthetrendline.Alerttriggeringconditionsareevaluatedintra-bar.

2-Breakoutonclose

AnalertistriggerediftheCloseofthepreviousbarwasbelowthetrendlineandtheCloseofthecurrentbarisabovethetrendline,oriftheCloseofthepreviousbarwasabovethetrendlineandtheCloseofthecurrentbarisbelowthetrendline.AlerttriggeringconditionsareevaluatedatCloseofabar.

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

964

Page 965: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Setalertstatusto"Breakoutonclose"foratrendlinewiththeIDnumberof3:

Value1=TL_SetAlert(3,2);

965

Page 966: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetBegin

ModifiesthestartingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthestartingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

Usage

TL_SetBegin(TL_ID,sDate,sTime,sPriceValue)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

sDate-anumericalexpressionspecifyingthenewstartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime-anumericalexpressionspecifyingthenewstartingpointtime;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

sPriceValue-anumericalexpressionspecifyingthenewstartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

MovethestartingpointofthetrendlinewithanIDnumberof3to10:00AMonJanuary17thatapricevalueof1365:

966

Page 967: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_SetBegin(3,1080117,1000,1365);

967

Page 968: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetBegin_BN

ModifiesthestartingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthestartingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Betweenthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

InsteadofseparateDateandTimevaluesorasingleDateTimevalue,barnumberisused.

Usage

TL_SetBegin_BN(TL_ID,BarNumber,Price);

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber.

BarNumber-anumericalexpressionspecifyingthetrendlinestartingpointbarnumber.

Price-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart).

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

SetthebeginningpointofTrendLinewithID=3toclosepriceofcurrentbar

Value1=TL_SetBegin_BN(3,currentbar[100],Close[100]);

968

Page 969: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetBegin_DT

ModifiesthestartingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthestartingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

InsteadofseparateDateandTimevalues,asingleDateTimevalueisused.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

TL_SetBegin_DT(TL_ID,b_DateTime,b_Price);

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

b_DateTime-anumericalexpressionspecifyingthetrendlinestartingpointdateandtime;isindicatedintheDateTimeformat.TheintegerportionoftheDateTimevalueindicatesthenumberofdaysthathaveelapsedsinceJanuary1st,1900,andthefractionalportionoftheDateTimevalueindicatesthefractionofthedaythathaspassedsincemidnight.

b_Price-anumericalexpressionspecifyingthetrendlinestartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_DTwhenthetrendlineiscreated.

Example

969

Page 970: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

SetthebeginningpointofTrendLinewithID=value1toopenprice100barsback

TL_SetBegin_DT(value1,DateTime[100],Open[100]);

970

Page 971: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetBegin_s

ModifiesthestartingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthestartingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththeearlierdateandtimeisalwaysconsideredtobethestartingpoint;ifthetrendlineisvertical,thepointwiththelowerpricevalueisconsideredtobethestartingpoint.

Usage

TL_SetBegin_s(TL_ID,sDate,sTime_s,sPriceValue)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

sDate-anumericalexpressionspecifyingthenewstartingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

sTime_s-anumericalexpressionspecifyingthenewstartingpointtime,includingseconds;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

sPriceValue-anumericalexpressionspecifyingthenewstartingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_swhenthetrendlineiscreated.

Example

971

Page 972: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MovethestartingpointofthetrendlinewithanIDnumberof3to10:00:00AMonJanuary17thatapricevalueof1365:

Value1=TL_SetBegin_s(3,1080117,100000,1365);

972

Page 973: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetColor

AssignsthespecifiedcolortoatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthecolorwassuccessfullyassigned,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetColor(TL_ID,TL_Color)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

TL_Color-anexpressionspecifyingthetrendlinecolor

TrendlinecolorcanbespecifiedbyanumericalexpressionrepresentinganRGBcolornumberoralegacycolorvalue,orbyoneof17basecolorwords.

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

AssignthecolorbluetothetrendlinewithanIDnumberof3:

Value1=TL_SetColor(3,Blue);

AssigntheRGBcolor2138336(Orange)tothetrendlinewithanIDnumberof3:

Value1=TL_SetColor(3,2138336);

Assignthelegacycolor4(Green)tothetrendlinewithanIDnumberof3:

[LegacyColorValue=True];Value1=TL_SetColor(3,4);

973

Page 974: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

974

Page 975: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetEnd

ModifiestheendingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheendingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

Usage

TL_SetEnd(TL_ID,eDate,eTime,ePriceValue)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

eDate-anumericalexpressionspecifyingthenewendingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

eTime-anumericalexpressionspecifyingthenewendingpointtime;thetimeisindicatedinthe24-hourHHmmformat,where1300=1:00PM

ePriceValue-anumericalexpressionspecifyingthenewendingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

MovetheendingpointofthetrendlinewithanIDnumberof3to14:15PMonJanuary17thatapricevalueof1350:

975

Page 976: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_SetEnd(3,1080117,1415,1350);

976

Page 977: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetEnd_BN

ModifiestheendingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheendingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Betweenthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

InsteadofseparateDateandTimevaluesorasingleDateTimevalue,barnumberisused.

Usage

TL_SetEnd_BN(TL_ID,BarNumber,Price);

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber.

BarNumber-anumericalexpressionspecifyingthetrendlineendingpointbarnumber.

Price-anumericalexpressionspecifyingthetrendlineendingpointpricevalue.

Example

SettheendingpointofTrendLinewithID=3toclosepriceofthecurrentbar

Value1=TL_SetEnd_BN(3,currentbar,Close);

977

Page 978: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetEnd_Dt

ModifiestheendingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheendingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

InsteadofseparateDateandTimevalues,asingleDateTimevalueisused.Itallowsaccessingmillisecondtimestampsofthebar.

Usage

TL_SetEnd_Dt(TL_ID,e_DateTime,e_Price);

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber.

e_DateTime-anumericalexpressionspecifyingthetrendlineendingpointdateandtime;thedateandtimeareindicatedintheDateTimeformat.

e_Price-anumericalexpressionspecifyingthetrendlineendingpointpricevalue.

Example

SettheendingpointofTrendLinewithID=value1toclosepriceofthecurrentbar

TL_SetEnd_Dt(value1,DateTime,Close);

978

Page 979: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetEnd_s

ModifiestheendingpointlocationofatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheendingpointlocationwassuccessfullymodified,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Ofthetwoendpointsofatrendline,thepointwiththelaterdateandtimeisalwaysconsideredtobetheendingpoint;ifthetrendlineisvertical,thepointwiththehigherpricevalueisconsideredtobetheendingpoint.

Usage

TL_SetEnd_s(TL_ID,eDate,eTime_s,ePriceValue)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

eDate-anumericalexpressionspecifyingthenewendingpointdate;thedateisindicatedintheYYYMMddformat,whereYYYisthenumberofyearssince1900,MMisthemonth,andddisthedayofthemonth

eTime_s-anumericalexpressionspecifyingthenewendingpointtime,includingseconds;thetimeisindicatedinthe24-hourHHmmssformat,where130000=1:00:00PM

ePriceValue-anumericalexpressionspecifyingthenewendingpointpricevalue(verticalposition,correspondingtoavalueonthepricescaleofachart)

Notes

Atrendline-specificIDnumberisreturnedbyTL_New_swhenthetrendlineiscreated.

Example

979

Page 980: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

MovetheendingpointofthetrendlinewithanIDnumberof3to14:15:00PMonJanuary17thatapricevalueof1350:

Value1=TL_SetEnd_s(3,1080117,141500,1350);

980

Page 981: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetExtLeft

Addsorremovesaleft-sideextensionforatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetExtLeft(TL_ID,LogicalExpression)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Addaleft-sideextensiontothetrendlinewithanIDnumberof3:

Value1=TL_SetExtLeft(3,True);

Removealeft-sideextensionfromthetrendlinewithanIDnumberof3:

Value1=TL_SetExtLeft(3,False);

981

Page 982: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetExtRight

Addsorremovesaright-sideextensionforatrendlinewiththespecifiedIDnumber;returnsavalueof0iftheoperationwasperformedsuccessfully,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetExtRight(TL_ID,LogicalExpression)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumberLogicalExpression-alogicalvalue;True=AddandFalse=Remove

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Addaright-sideextensiontothetrendlinewithanIDnumberof3:

Value1=TL_SetExtRight(3,True);

Removearight-sideextensionfromthetrendlinewithanIDnumberof3:

Value1=TL_SetExtRight(3,False);

982

Page 983: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetSize

AssignsthespecifiedwidthtoatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthelinewidthwassuccessfullyassigned,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetSize(TL_ID,LineWidth)

Where:TL_ID-anumericalexpressionspecifyingthetrendlineIDnumberLineWidth-anumericalexpressionspecifyingthetrendlinewidth;trendlinewidthcanrangefrom0to6

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

Assignthewidthof5tothetrendlinewithanIDnumberof3:

Value1=TL_SetSize(3,5);

983

Page 984: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

TL_SetStyle

AssignsthespecifiedstyletoatrendlinewiththespecifiedIDnumber;returnsavalueof0ifthetrendlinestylewassuccessfullyassigned,andavalueof-2ifthespecifiedtrendlineIDnumberisinvalid.

Usage

TL_SetStyle(TL_ID,TL_Style)

Parameters

TL_ID-anumericalexpressionspecifyingthetrendlineIDnumber

TL_Style-aTLstyleconstantoranumericalexpressionspecifyingthetrendlinestyleasfollows:

Tool_Solid 1

______________________

Tool_Dashed 2 -------------------Tool_Dotted 3 ............................................Tool_Dashed2 4 _________________Tool_Dashed3 5 __________________

Notes

Atrendline-specificIDnumberisreturnedbyTL_Newwhenthetrendlineiscreated.

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed:

984

Page 985: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Value1=TL_SetStyle(3,2);

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed:

Value1=TL_SetStyle(3,Tool_Dashed);

985

Page 986: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tool_Dashed

Constant,usedincombinationwithTL_SetStyletodesignatetheToolDashedstyle;canbesubstitutedbyanumericalvalueof2.

Usage

TL_SetStyle(TL_ID,Tool_Dashed)

or:

TL_SetStyle(TL_ID,2)

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed:

Value1=TL_SetStyle(3,2);

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed:

Value1=TL_SetStyle(3,Tool_Dashed);

986

Page 987: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tool_Dashed2

Constant,usedincombinationwithTL_SetStyletodesignatetheToolDashed2style;canbesubstitutedbyanumericalvalueof4.

Usage

TL_SetStyle(TL_ID,Tool_Dashed2)

or:

TL_SetStyle(TL_ID,4)

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed2:

Value1=TL_SetStyle(3,4);

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed2:

Value1=TL_SetStyle(3,Tool_Dashed2);

987

Page 988: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tool_Dashed3

Constant,usedincombinationwithTL_SetStyletodesignatetheToolDashed3style;canbesubstitutedbyanumericalvalueof5.

Usage

TL_SetStyle(TL_ID,Tool_Dashed3)

or:

TL_SetStyle(TL_ID,5)

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed3:

Value1=TL_SetStyle(3,5);

SetthestyleofthetrendlinewithanIDnumberof3toToolDashed3:

Value1=TL_SetStyle(3,Tool_Dashed3);

988

Page 989: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tool_Dotted

Constant,usedincombinationwithTL_SetStyletodesignatetheToolDottedstyle;canbesubstitutedbyanumericalvalueof3.

Usage

TL_SetStyle(TL_ID,Tool_Dotted)

or:

TL_SetStyle(TL_ID,3)

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolDotted:

Value1=TL_SetStyle(3,3);

SetthestyleofthetrendlinewithanIDnumberof3toToolDotted:

Value1=TL_SetStyle(3,Tool_Dotted);

989

Page 990: PowerLanguage Keyword Reference - MultiCharts · Magenta Margin Market MarketPosition MarketPosition_at_Broker MarketPosition_at_Broker_for_The_Strategy MarketPosition_Checked MaxBarsBack

Tool_Solid

Constant,usedincombinationwithTL_SetStyletodesignatetheToolSolidstyle;canbesubstitutedbyanumericalvalueof1.

Usage

TL_SetStyle(TL_ID,Tool_Solid)

or:

TL_SetStyle(TL_ID,1)

Example

SetthestyleofthetrendlinewithanIDnumberof3toToolSolid:

Value1=TL_SetStyle(3,1);

SetthestyleofthetrendlinewithanIDnumberof3toToolSolid:

Value1=TL_SetStyle(3,Tool_Solid);

990