NexusFi: Find Your Edge


Home Menu

 





Need EasyLanguage help with HighD(1)


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one 10handles with 4 posts (0 thanks)
    2. looks_two kevinkdog with 3 posts (1 thanks)
    3. looks_3 DeanJ with 1 posts (1 thanks)
    4. looks_4 ABCTG with 1 posts (1 thanks)
    1. trending_up 3,251 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 1 attachments




 
Search this Thread

Need EasyLanguage help with HighD(1)

  #1 (permalink)
 10handles 
San Francisco CA
 
Experience: Beginner
Platform: TradeStation
Trading: Options
Posts: 10 since Apr 2014
Thanks Given: 4
Thanks Received: 2

I'm trying to create a simple strategy to enter long on an intraday close over yesterday's high. This code is returning long entries below the prior day's high. Any ideas why?

If close > HighD(1) then buy next bar at market;

Thank you.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


10handles View Post
I'm trying to create a simple strategy to enter long on an intraday close over yesterday's high. This code is returning long entries below the prior day's high. Any ideas why?

If close > HighD(1) then buy next bar at market;

Thank you.

Can you show an example where this is not working as you expect?

Maybe you want this: If close > HighD(1) then buy next bar at HighD(1) limit;

Follow me on Twitter Reply With Quote
  #3 (permalink)
 10handles 
San Francisco CA
 
Experience: Beginner
Platform: TradeStation
Trading: Options
Posts: 10 since Apr 2014
Thanks Given: 4
Thanks Received: 2



kevinkdog View Post
Can you show an example where this is not working as you expect?

Maybe you want this: If close > HighD(1) then buy next bar at HighD(1) limit;

Thanks Kevin. That didn't solve the problem. Here's a screenshot. Yellow lines are prior session high.


Started this thread Reply With Quote
  #4 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


10handles View Post
Thanks Kevin. That didn't solve the problem. Here's a screenshot. Yellow lines are prior session high.



Trade 2 is doing exactly what it is supposed to: If the close at end of day is greater than the previous high, then buy at the open of the next bar. The decision to buy is made at the close of the day, regardless of a gap down at the start of the next day.

What about "if open next bar > highd(1) then buy this bar at market" or "if open next bar > highd(1) then buy this bar at close" (I did not test, you'll have to check this)

Follow me on Twitter Reply With Quote
  #5 (permalink)
 DeanJ 
St Louis MO
 
Experience: Intermediate
Platform: tradestation
Trading: stocks
Posts: 8 since May 2011
Thanks Given: 3
Thanks Received: 2

I think all 3 trades are doing what they are supposed to do. Your statement close>HighD(1) says at the close of any bar, whether it is at the end of the day or in the middle of the day, if the close of that bar is higher than yesterday's High it is supposed to buy on the next bar. Doesn't matter if the next bar is the middle of the day or it is the first bar on the next day.

Reply With Quote
Thanked by:
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

10handles,

you might want to exclude the last bar of each session from triggering trades, as the fill will occur on the next session. You can either use an input or a fixed time like "if Time < 1600" or use the SessionEndTime reserved word to get the end time for the particular session.

Regards,
ABCTG


10handles View Post
Thanks Kevin. That didn't solve the problem. Here's a screenshot. Yellow lines are prior session high.



Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 10handles 
San Francisco CA
 
Experience: Beginner
Platform: TradeStation
Trading: Options
Posts: 10 since Apr 2014
Thanks Given: 4
Thanks Received: 2

Thank you Kevin, ABCTG and Dean.

Yes the last bar was causing the problem. The workaround I used for now is to add "If marketposition = 0" as a condition since I have it send to exit at the end of the session.

I know very little about EL/coding so it will take me some time to figure out how to exclude the last bar of each session but that is probably the better solution since I may want to explore a different exit strategy then session end.

Best regards.

Started this thread Reply With Quote
  #8 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,663 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,357


10handles View Post
Thank you Kevin, ABCTG and Dean.

Yes the last bar was causing the problem. The workaround I used for now is to add "If marketposition = 0" as a condition since I have it send to exit at the end of the session.

I know very little about EL/coding so it will take me some time to figure out how to exclude the last bar of each session but that is probably the better solution since I may want to explore a different exit strategy then session end.

Best regards.


Simple. Say the time of the last bar of the day is 1600.. then do this:

If time<1600 then begin

' your entry code

end;

That will prevent an entry based on that last bar

Follow me on Twitter Reply With Quote
Thanked by:
  #9 (permalink)
 10handles 
San Francisco CA
 
Experience: Beginner
Platform: TradeStation
Trading: Options
Posts: 10 since Apr 2014
Thanks Given: 4
Thanks Received: 2


kevinkdog View Post
Simple. Say the time of the last bar of the day is 1600.. then do this:

If time<1600 then begin

' your entry code

end;

That will prevent an entry based on that last bar

Super, thanks Kevin!

Started this thread Reply With Quote




Last Updated on October 23, 2015


© 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