Execut a function if click on the upper corner: How to do it  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Execut a function if click on the upper corner: How to do it

Postby arjfca » 17 Dec 2013

Hello

I'm looking for a way to execute a function if a click is done on the upper or lower right of the screen

How can I detect the click on the upper right region? I know I can read the upper / lowest price displayable on the screen using GetAppInfo(aiHighestDispValue) but that is not a condition

Actually, I coded to trigger if the click occurred in .5% or .95% of the entire price area. Work OK but the trigger is not define for the right part of the screen. Meaning, If I click anywhere above .95% of the displayable price area

Code: Select all


HighestPrice = Getappinfo(aiHighestDispValue);
Lowestprice = Getappinfo(aiLowestDispValue);

UpperPart = HighestPrice - (.05 * (HighestPrice-LowestPrice));
LowerPart = HighestPrice - (.95 * (HighestPrice-LowestPrice));

if vclickprice >= upperpart then Print ("ClickUpper Part");
if vclickprice <= Lowerpart then Print ("ClickLower Part");
Hope I'm clear.

Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Execut a function if click on the upper corner: How to d  [SOLVED]

Postby arjfca » 17 Dec 2013

Resolved:

Code: Select all

if vclickprice >= upperpart and (vClickBarNbr = (barnumber + maxbarsback )) then Print ("ClickUpper Part");

if vclickprice <= Lowerpart and (vClickBarNbr = (barnumber + maxbarsback )) then Print ("ClickLower Part");
I added a condition
Read the clicked barnumber
Read MC last Barnumber and added the maxBarBack

When the clicked barnumber is equal to the last barnumer + MaxBarBack the region clicked is in the most right side of the screen

Martin

User avatar
Smoky
Posts: 507
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 97 times
Been thanked: 115 times

Re: Execut a function if click on the upper corner: How to d

Postby Smoky » 18 Dec 2013

hi arjfca ,

now I think that you can use Symbol_CurrentBar easy reading than 'barnumer + MaxBarBack'

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Execut a function if click on the upper corner: How to d

Postby arjfca » 19 Dec 2013

hi arjfca ,

now I think that you can use Symbol_CurrentBar easy reading than 'barnumer + MaxBarBack'
Thank you Smoky
Was not aware of this function

All the best for this Holiday Season

Martin

maxmax68
Posts: 163
Joined: 20 Nov 2012
Has thanked: 55 times
Been thanked: 48 times

Re: Execut a function if click on the upper corner: How to d

Postby maxmax68 » 29 Dec 2013

Hi,
please where can I find more informations about Symbol_CurrentBar ?

Regards
Massimo

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Execut a function if click on the upper corner: How to d

Postby TJ » 29 Dec 2013

Hi,
please where can I find more informations about Symbol_CurrentBar ?

Regards
Massimo
Look under the section:
PowerLanguage Keyword Reference
Category: Data Information/General
https://www.multicharts.com/trading-sof ... /Main_Page


Return to “MultiCharts”