NexusFi: Find Your Edge


Home Menu

 





MouseClickShiftPressed


Discussion in MultiCharts

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




 
Search this Thread

MouseClickShiftPressed

  #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?
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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 Twitter Reply With Quote
Thanked by:




Last Updated on September 16, 2019


© 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