NexusFi: Find Your Edge


Home Menu

 





Code price level alerts?


Discussion in TradeStation

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




 
Search this Thread

Code price level alerts?

  #1 (permalink)
Jbird10
Dallas, Texas
 
Posts: 2 since Dec 2011
Thanks Given: 0
Thanks Received: 0

I'm just an OK coder for my indicators and been able to code alerts with plot points. I'm trying to code alerts when price gets close to the "quarters" like near the hundreds levels for price. I've found alerts just about for everything but "price levels" being crossed. Any help pointing me in the right direction is much appreciated for Tradestation.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 TraderDoc2 
Plainview
 
Experience: Intermediate
Platform: TradeStation
Broker: TradeStation
Trading: Futures
Posts: 34 since Mar 2012
Thanks Given: 1
Thanks Received: 21

I'm not sure if this is what you mean but say you are looking at stock AMD with a daily chart and the last date is 3/27/2023. The stock was rising then falling around the $100 per share level near that date. You could use the following indicator code to plot and alert when the closing price crossed above and below 100. For scaling the indicator, you would plot on the same axis as the underlying data ["Scaling" is on the left side of the customize indicator dialogue]. "Alert" is also on the left side of the customize indicator dialogue window]. You might choose to alert once per bar and clear the alert on bar close. You can use MyDelta as a small offset if you wish (e.g. $1), or leave it at 0.

 
Code

Inputs:
	Price(Close),
	MyAlertPrice(100),
	MyDelta(0);
	

If Price crosses above MyAlertPrice - MyDelta then begin
	If AlertEnabled then Alert("Price Rising Toward or Above Alert Price " + GetSymbolName);
	Plot1(High + 0.4 * Average(Range,5),"Rising");
end;

If Price crosses below MyAlertPrice + MyDelta then begin
	If AlertEnabled then Alert("Price Falling Toward or Below Alert Price " + GetSymbolName);
	Plot2(Low - 0.4 * Average(Range,5),"Falling");
end;

Follow me on Twitter Reply With Quote




Last Updated on May 7, 2023


© 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