NexusFi: Find Your Edge


Home Menu

 





volatility breakout


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Small Dog with 4 posts (0 thanks)
    2. looks_two vmodus with 3 posts (1 thanks)
    3. looks_3 edgefirst with 1 posts (0 thanks)
    4. looks_4 jkepha with 1 posts (0 thanks)
    1. trending_up 9,506 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
Search this Thread

volatility breakout

  #1 (permalink)
 
Small Dog's Avatar
 Small Dog 
Sydney NSW Australia
 
Experience: Intermediate
Platform: TradeStation, Oanda
Trading: Forex, index futures
Frequency: Daily
Duration: Days
Posts: 161 since Jun 2020
Thanks Given: 10
Thanks Received: 151

Guys, I am stuck. I don't know if this version of TS is so different from i2000, but for the life of me I cannot get this to work.

I am trying to code the following strategy:

Enter long at today's open + yesterday's high - low;
Trailing stop - low of previous bar;
Profit target 50 pips;

For some reason I can only get the platform to buy at today's close + today's range. I guess for forex today's open is the same as yesterday's close, so that should be ok.

I am using SetProfitTarget function to for the profit stop - but I am not sure how to set it up with both long and short trades. Does it automatically assume the appropriate market position?

I am coding this based on daily bars. Should I try lower time frame instead?

I don't expect hand holding and being handed out the solution, but every advice will be highly appreciated.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #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


ursus View Post
Guys, I am stuck. I don't know if this version of TS is so different from i2000, but for the life of me I cannot get this to work.

I am trying to code the following strategy:

Enter long at today's open + yesterday's high - low;
Trailing stop - low of previous bar;
Profit target 50 pips;

For some reason I can only get the platform to buy at today's close + today's range. I guess for forex today's open is the same as yesterday's close, so that should be ok.

I am using SetProfitTarget function to for the profit stop - but I am not sure how to set it up with both long and short trades. Does it automatically assume the appropriate market position?

I am coding this based on daily bars. Should I try lower time frame instead?

I don't expect hand holding and being handed out the solution, but every advice will be highly appreciated.

Please share your EasyLanguage code and let's see what we can do. Also, which version of TradeStation are you using? (9.5, 10, etc.)

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
Small Dog's Avatar
 Small Dog 
Sydney NSW Australia
 
Experience: Intermediate
Platform: TradeStation, Oanda
Trading: Forex, index futures
Frequency: Daily
Duration: Days
Posts: 161 since Jun 2020
Thanks Given: 10
Thanks Received: 151


I think I cried for help too soon. Anyway, below is the code for the strategy. Pretty self explanatory. results are not impressive on currencies.

{Larry Williams volatility breakout strategy.
Long entry: open + yesterday's range * multiplier
Short entry: open - yesterday's range * multiplier
Exits: Profit target and trailing stop on n bars high/low}

Inputs:
Multiplier(1.0),
Trailing(5),
UTarget(300);

Vars: TriggerRange(0),
GoLongPoint(0),
GoShortPoint(0);

TriggerRange = High - Low;
GoLongPoint = Open of tomorrow + TriggerRange * Multiplier;
GoShortPoint = Open of tomorrow - TriggerRange * Multiplier;


Buy next bar at GoLongPoint stop;
Sellshort next bar at GoShortPoint Stop;

If marketposition = 1 then begin
Sell next bar at lowest(low, Trailing) stop;
SetProfitTarget(UTarget);
End;

If MarketPosition = -1 then begin
Buytocover next bar at highest(high, Trailing) stop;
SetProfitTarget(UTarget);
End;

Started this thread Reply With Quote
  #4 (permalink)
 
Small Dog's Avatar
 Small Dog 
Sydney NSW Australia
 
Experience: Intermediate
Platform: TradeStation, Oanda
Trading: Forex, index futures
Frequency: Daily
Duration: Days
Posts: 161 since Jun 2020
Thanks Given: 10
Thanks Received: 151

This strategy seems to have pretty wild equity fluctuations. It doesn't do very well in times of low volatility. I am going to play with volatility filters.

Started this thread Reply With Quote
  #5 (permalink)
 
Small Dog's Avatar
 Small Dog 
Sydney NSW Australia
 
Experience: Intermediate
Platform: TradeStation, Oanda
Trading: Forex, index futures
Frequency: Daily
Duration: Days
Posts: 161 since Jun 2020
Thanks Given: 10
Thanks Received: 151

And now I stumbled on couple of other problems. I can apply this strategy to some pairs but not others. It works with AUDUSD with no issues, but on USDCHF doesn't generate any trades. Am I overlooking something?

Also, sometimes the strategy executes profit taking in a strange way: at the same level as entry, as illustrated on the second trade in the screenshot below. Apparently using the function SetProfitTarget should take care of it, but it appears not always.


Started this thread Reply With Quote
  #6 (permalink)
 edgefirst 
Las Cruces, NM
 
Experience: Advanced
Platform: Tradestation, MC, NT
Broker: TradeStation, IB
Trading: Liquid futures contracts
Posts: 56 since Sep 2009
Thanks Given: 389
Thanks Received: 86


ursus View Post

Also, sometimes the strategy executes profit taking in a strange way: at the same level as entry, as illustrated on the second trade in the screenshot below. Apparently using the function SetProfitTarget should take care of it, but it appears not always.


It appears that your profit target is too small relative to the overall bar range. Try set the "inside-bar" to 1min (turned off by default) in Tradestation.

Reply With Quote
  #7 (permalink)
jkepha
San Antonio, TX
 
Posts: 31 since Apr 2020
Thanks Given: 10
Thanks Received: 6

Pretty sure it doesn't care if you are long or short. If you hit that pnl it will close you out.




ursus View Post
Guys, I am stuck. I don't know if this version of TS is so different from i2000, but for the life of me I cannot get this to work.

I am trying to code the following strategy:

Enter long at today's open + yesterday's high - low;
Trailing stop - low of previous bar;
Profit target 50 pips;

For some reason I can only get the platform to buy at today's close + today's range. I guess for forex today's open is the same as yesterday's close, so that should be ok.

I am using SetProfitTarget function to for the profit stop - but I am not sure how to set it up with both long and short trades. Does it automatically assume the appropriate market position?

I am coding this based on daily bars. Should I try lower time frame instead?

I don't expect hand holding and being handed out the solution, but every advice will be highly appreciated.


Reply With Quote
  #8 (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


ursus View Post
Guys, I am stuck. I don't know if this version of TS is so different from i2000, but for the life of me I cannot get this to work.

I am trying to code the following strategy:

Enter long at today's open + yesterday's high - low;
Trailing stop - low of previous bar;
Profit target 50 pips;

For some reason I can only get the platform to buy at today's close + today's range. I guess for forex today's open is the same as yesterday's close, so that should be ok.

I am using SetProfitTarget function to for the profit stop - but I am not sure how to set it up with both long and short trades. Does it automatically assume the appropriate market position?

I am coding this based on daily bars. Should I try lower time frame instead?

I don't expect hand holding and being handed out the solution, but every advice will be highly appreciated.

The online help is your best friend. Look for 'Buy' in the TradeStation Development Environment Dictionary and you will find some examples.

Also, open some of the sample strategies they provide, so you should have a good starting point. It seems like you want your entries to be stop orders (not sure). For trailing stops, look at this strategy to get started: _Stops & Targets

~vmodus

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




Last Updated on October 15, 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