NexusFi: Find Your Edge


Home Menu

 





Easy/PowerLanguage Equiv. of ValueWhen and LastValue


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one OZ Trade with 2 posts (0 thanks)
    2. looks_two ABCTG with 1 posts (0 thanks)
    3. looks_3 sptrader with 1 posts (0 thanks)
    4. looks_4 no erocla with 1 posts (0 thanks)
    1. trending_up 2,644 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Easy/PowerLanguage Equiv. of ValueWhen and LastValue

  #1 (permalink)
OZ Trade
Brisbane
 
Posts: 2 since Oct 2013
Thanks Given: 0
Thanks Received: 0

Looking for the equivalent of ValueWhen() and/or LastValue() from Metastock in Easy/PowerLanguage for TradeStation/Multicharts

Any help on this would be much appreciated, I have wasted many hours trying to work around it.

Thanks,

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
53 thanks
Funded Trader platforms
44 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

You can reference previous bars values in Multicharts and TradeStation like this:

MyValue[x]

where MyValue is the variable you are working with and x is the number of bars back from the current bar (0 = current bar).

I don't know about ValueWhen() and LastValue() in Metastock, but I hope the above helps you.

Regards,

ABCTG


OZ Trade View Post
Looking for the equivalent of ValueWhen() and/or LastValue() from Metastock in Easy/PowerLanguage for TradeStation/Multicharts

Any help on this would be much appreciated, I have wasted many hours trying to work around it.

Thanks,


Follow me on Twitter Reply With Quote
  #3 (permalink)
OZ Trade
Brisbane
 
Posts: 2 since Oct 2013
Thanks Given: 0
Thanks Received: 0


Thanks for the suggestion, [x] is something I most certainly already use, it is specific to 'number of bars back or forward' from the current calc. bar though.

Some more info on what I'm looking for:

ValueWhen(Nth, Expression, Data Array)

Nth _ Is the number of occurrences, of the `expression', you wish to refer back when obtaining the value of the selected data array.

Expression _ The technical condition that you are going back through the data to search for and the `N' will dictate how many occurrences you count back.

Data Array _ On the period that `Expression' is found `N' times ago, it is the value of this data array that is returned.

LastValue( Data Array)

This function will always return the last value of a data array. Put another way, the function:

LastValue ( close )

returns the closing price for the last day of data available. By the same token, the function:

LastValue(MACD())

returns the MACD has on the last day of data available.

The same value is returned no matter when the lastvalue() function is calculated. If the Data Array is undefined for any reason, LastValue will return a 0.

Since the function, in effect looks into the future, it is not acceptable for most custom indicators. It is; however, very beneficial for things likes
pattern recognition.

-------------------------------------------

Effectively I need to refer to the nth occurrence of a specific expression value in the past and return an OHLC value for that occurrence.. also to be able to refer to the last value (value at most recent bar) of a particular expression from any previous bar on the chart.

Reply With Quote
  #4 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4

Hello,

Amibroker
x = valuewhen(condition,y);

Multicharts
if ( condition ) then
x = y;

Bye

Reply With Quote
  #5 (permalink)
 
sptrader's Avatar
 sptrader 
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
Posts: 535 since Apr 2010
Thanks Given: 1,097
Thanks Received: 701

" CountIf " function may help, it counts the number of times something happens..

Reply With Quote




Last Updated on October 20, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts