NexusFi: Find Your Edge


Home Menu

 





How do I put a stop limit order below instead of a stop order?


Discussion in TradeStation

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




 
Search this Thread

How do I put a stop limit order below instead of a stop order?

  #1 (permalink)
qq504756010
San Jose
 
Posts: 1 since Dec 2020
Thanks Given: 1
Thanks Received: 0

{ Search Tag: WA-New High LE }

{
This strategy buys on a new high for the chart or for the specified calendar
period - day, week, month or year.

The IntrabarOrderGeneration attribute is set to false in this strategy because
strategy calculations depend on end-of-bar prices. Specifically, in this strategy
the end-of-bar high is used.
}

[IntrabarOrderGeneration = false]

inputs:
int PeriodType( 1 ) [DisplayName = "PeriodType", ToolTip =
"Enter the time period for which the code is looking for a new High. Enter 1 for chart, 2 for day, 3 for week, 4 for month, 5 for year."];

variables:
int BT( BarType ),
bool LastBarOfPeriod( false ),
{
HighestHi is initialized to a large positive value to ensure that if a
calendar period is specified, the first such period on the chart is ignored
because it may be incomplete
}
double HighestHi( 1000000 ),
bool IsDailyBarOrShorter( false ),
bool IsWeeklyBarOrShorter( false ),
bool IsMonthBarOrShorter( false ),
bool NextBarIsNewDay( false ),
bool NextBarIsNewWeek( false ),
bool NextBarIsNewMonth( false ),
bool NextBarIsNewYear( false );

if CurrentBar = 1 then
begin
IsDailyBarOrShorter = BT <= 2 or BT = 14;
IsWeeklyBarOrShorter = BT <= 3 or BT = 14;
IsMonthBarOrShorter = BT <= 4 or BT = 14;
end;

NextBarIsNewDay = Date <> Date next bar;
NextBarIsNewWeek = DayOfWeek( Date) > DayOfWeek( Date next bar );
NextBarIsNewMonth = Month( Date ) <> Month( Date next bar );
NextBarIsNewYear = Year( Date ) <> Year( Date next bar );

if ( PeriodType = 2 and IsDailyBarOrShorter and NextBarIsNewDay )
or ( PeriodType = 3 and IsWeeklyBarOrShorter and NextBarIsNewWeek )
or ( PeriodType = 4 and IsMonthBarOrShorter and NextBarIsNewMonth )
or ( PeriodType = 5 and IsMonthBarOrShorter and NextBarIsNewYear )
then
LastBarOfPeriod = true
else
LastBarOfPeriod = false;

if ( CurrentBar = 1 and ( PeriodType <= 1 or PeriodType > 5 ) )
or LastBarOfPeriod[1]
or High > HighestHi
then
HighestHi = High;

if LastBarOfPeriod = false then
Buy( !( "NewHi" ) ) next at bar at HighestHi + 1 point stop;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
Quant vue
Trading Reviews and Vendors
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
 
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

You cannot place a stop limit order in standard EasyLanguage.

https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=103239

You can use the OrderTicket functionality or OOEL, but that is a little bit beyond the scope of what I can answer here. Go check out the community forums at TradeStation for more assistance on this.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on December 17, 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