NexusFi: Find Your Edge


Home Menu

 





Trading Entry Based on Manually Drawn Trendlines


Discussion in EasyLanguage Programming

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




 
Search this Thread

Trading Entry Based on Manually Drawn Trendlines

  #1 (permalink)
achaean2711
Montreal, QC
 
Posts: 1 since Apr 2020
Thanks Given: 0
Thanks Received: 0

Hi all,

I'm doing some practice with generating a trading entry based off of a manually drawn trendline. In a recent example, I'm struggling to get a strategy to recognize a trendline I've manually drawn on the chart. It appears that TL_Exist remains false throughout the chart. Perhaps I need to change TLID? Do I need to determine what the ID is on a manually drawn line? Otherwise... any thoughts or ideas that could steer me in the right direction? Your assistance is greatly appreciated!

 
Code
Inputs:
	TradeSize(500),
	TLID(1);
	
Vars:
	TLV(0),
	TLVPrev(0);
	
if TradeSize <> 0 AND TLID > 0 then 
Begin
	TLV = 0;
	TLVPrev = 0;

	if LastBarOnChart AND TL_Exist(TLID) then 
	Begin
		TLV = TL_GetValue(TLID, Date, Time);
		TLVPrev = TL_GetValue(TLID, Date[1], Time[1]);
	
		if TLVPrev > 0 and TLV >0 then 
		Begin
			TLV = TLV + (TLV - TLVPrev);
			if TradeSize > 0 then 
				Begin
					if Close > TLV Then
						buy("TLBuy LE") next Bar TradeSize shares at TLV Limit
						Else
						Buy("TL Buy LE") next Bar
						TradeSize shares at TLV stop;
				End
				Else
				if Close < TLV Then
					Sellshort("TL Short LE") next bar -TradeSize shares at TLV Limit
					Else
					SellShort("TLShort SE") next bar -TradeSize shares at TLV stop;
		end;
	End;
end;

print(TL_Exist(TLID));

Reply With Quote




Last Updated on June 2, 2020


© 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