NexusFi: Find Your Edge


Home Menu

 





MouseClickShiftPressed


Discussion in MultiCharts

Updated
    1. trending_up 1,354 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

Hi,

I created an indicator using the MouseClickShiftPressed reserved word in MultiCharts and it works great. But there is one thing I would like it to do that I can't figure out how to code. if I am clicking off a high, I want a subtraction to be done and if I am clicking off a low, I want an addition to be done in my formula. How can I program it so that when I click, MC knows that I want a high or low? I have left most of the math out of the formula. Step4 is what I would like to change to an addition if I click on a low or a subtraction if I click on a high. Thank you.

 
Code
Inputs: Add(60), Chart_Length(2), iMultiplier(1), iSquare(2), TL_Colour(cyan), Txt_Colour(cyan);

[ProcessMouseEvents = true];
[RecoverDrawings = false];

switch (getappinfo(aicalcreason)) begin
	case CalcReason_MouseLClick : if MouseClickShiftPressed then begin
			
		var : recalcpersist iPrice(0), 
		recalcpersist iBar1(0),
		recalcpersist iBar2(0),
		recalcpersist dt1(0), 
		recalcpersist dt2(0),
		recalcpersist dt3(0),
		recalcpersist Step1(0),
		recalcpersist Step2(0),
		recalcpersist Step3(0),
		recalcpersist Step4(0),
		recalcpersist Step5(0),
		recalcpersist Step6(0);	
		
		repeat
			if 0 = iBar1 then begin
				iBar1 = MouseClickDateTime;
				dt1 = MouseClickBarNumber;
				break;
			end;
			
			if 0 = iBar2 then begin
				iBar2 = MouseClickDateTime;
				dt2 = MouseClickBarNumber;
				break;
			end;
			
			if 0 = iPrice then begin
				iPrice = MouseClickDateTime;
				dt3 = MouseClickPrice;
				break;
			end;		
				
		until (False);
		
		if 0 <> iPrice and 0 <> iBar1 and 0 <> iBar2 then begin
		
		Step1 = ------------------------
		Step2 = ------------------------
		Step3 = ------------------------
		Step4 = Step3 + Step2;
		Step5 = ------------------------
		Step6 = ------------------------
		
		draw_hor_line(Step6, iPrice, TL_Colour, Txt_Colour,  "");		
					
			iBar1 = 0;
			iBar2 = 0;
			iPrice = 0;

		end;
	end;
end;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Thanks Mike. Godspeed.
The Elite Circle
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
16 thanks
Darmok and Jalad at Tanagra
3 thanks
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
1 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

olobay,

you could use MouseClickPrice and check if the click is at the lower or lower and do the addition or if the click is at the high or higher do a subtraction.
You could also use MouseClickShiftPressed to trigger one logic and MouseClickCtrlPressed to trigger another.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:




Last Updated on September 16, 2019


© 2026 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 - Downloads - Top
no new posts