How do I enter at a broken level one time only? - futures io
futures io futures trading



How do I enter at a broken level one time only?


Discussion in TradeStation

Updated by kjhosken
      Top Posters
    1. looks_one ReximusMaximus with 3 posts (0 thanks)
    2. looks_two kjhosken with 1 posts (0 thanks)
    3. looks_3 numberjuani with 1 posts (2 thanks)
    4. looks_4 Germany1960 with 1 posts (1 thanks)
    1. trending_up 992 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 5 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

How do I enter at a broken level one time only?

(login for full post details)
  #1 (permalink)
SAINT LOUIS
 
 
Posts: 20 since Aug 2019
Thanks: 5 given, 3 received

I'm trying to test a strategy that buys broken pivot levels.

I have the entries working fine, but I am having a very tough time getting the code to allow one trade per setup.

I've attempted to create a variable called buyflag, and when a trade is placed I set it equal to the buy_level_one (broken pivot high). This seems to work in that it allows only one buy, and I would imagine that I'd need to create thousands of these in order to test it over time.

I'm sure there's a simpler way to do this, for example maybe reference the most recent limit price, and I can check for that when placing the trade?

I'm very new to easylanguage and have been banging my head against a wall for a while on this and thought I'd ask for help.

Here's an example of the entry code:

 
Code
//long  entry	
if
	buyflag <> buy_level_one and
	buy_level_one > 0 and
	close > buy_level_one and
	time > starttime and
	time < endtime then begin
		buy next bar tradesize contracts buy_level_one+(buffer) limit;
		buyflag = buy_level_one;
	end;

Reply With Quote

Can you help answer these questions
from other members on futures io?
THINKorSWIM Scripting
ThinkOrSwim
I have segregated my investment and trading
Psychology and Money Management
Degiro Negative Balance Advice
Traders Hideout
3x Fangdango
Traders Hideout
QDEL
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
57 thanks
Price Action Kewltech Style
19 thanks
Coronavirus COVID-19
19 thanks
Trying to locate prop firm that purchased my automated trading system
11 thanks
Margins for MES
10 thanks
 
(login for full post details)
  #2 (permalink)
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
 
numberjuani's Avatar
 
Posts: 127 since Apr 2019
Thanks: 9 given, 94 received


ReximusMaximus View Post
I'm trying to test a strategy that buys broken pivot levels.

I have the entries working fine, but I am having a very tough time getting the code to allow one trade per setup.

I've attempted to create a variable called buyflag, and when a trade is placed I set it equal to the buy_level_one (broken pivot high). This seems to work in that it allows only one buy, and I would imagine that I'd need to create thousands of these in order to test it over time.

I'm sure there's a simpler way to do this, for example maybe reference the most recent limit price, and I can check for that when placing the trade?

I'm very new to easylanguage and have been banging my head against a wall for a while on this and thought I'd ask for help.

Here's an example of the entry code:

 
Code
//long  entry	
if
	buyflag <> buy_level_one and
	buy_level_one > 0 and
	close > buy_level_one and
	time > starttime and
	time < endtime then begin
		buy next bar tradesize contracts buy_level_one+(buffer) limit;
		buyflag = buy_level_one;
	end;

Try this before your order EntriesToday(date) = 0 if you want to only allow one trade a day and if you want to make sure its not taking the trade at the same level as before reference the previous entry price.

if EntryPrice(1) = buy_level_one then no trade!

Reply With Quote
The following 2 users say Thank You to numberjuani for this post:
 
(login for full post details)
  #3 (permalink)
SAINT LOUIS
 
 
Posts: 20 since Aug 2019
Thanks: 5 given, 3 received



numberjuani View Post
Try this before your order EntriesToday(date) = 0 if you want to only allow one trade a day and if you want to make sure its not taking the trade at the same level as before reference the previous entry price.

if EntryPrice(1) = buy_level_one then no trade!

Thanks for the suggestion, I'll mess around with this. I typically do only take one trade per day with this when I trade manually.

Cool dog btw!

edit: also that entryprice reserved word also may work perfectly.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
germany
 
 
Posts: 4 since Nov 2019
Thanks: 1 given, 2 received

You also can add this filter if you want to open only once a day

 
Code
//long  entry	
if
	buyflag <> buy_level_one and
	buy_level_one > 0 and
	close > buy_level_one and
	time > starttime and
        Closed_Daily <> CloseD(1) and
	time < endtime then begin
		buy next bar tradesize contracts buy_level_one+(buffer) limit;
		buyflag = buy_level_one;
                Closed_Daily = CloseD(1);

	end;

Reply With Quote
The following user says Thank You to Germany1960 for this post:
 
(login for full post details)
  #5 (permalink)
SAINT LOUIS
 
 
Posts: 20 since Aug 2019
Thanks: 5 given, 3 received

In case anyone stumbles across this thread with the same question, using entryprice worked like a charm if you're okay with multiple entries per day.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 81 since Sep 2016
Thanks: 7 given, 28 received

Another option if you want more than 1 trade per day, but only once at a given level might be to add a counter. (caveat, not sure the code below would work without knowing more fully how your entire code operates, so think of it conceptually more than anything)
 
Code
//long  entry	
if
	buyflag <> buy_level_one and
	buy_level_one > 0 and
	close > buy_level_one and
	time > starttime and
        Closed_Daily <> CloseD(1) and
        buy_level_one_counter = 0 and
	time < endtime then begin
		buy next bar tradesize contracts buy_level_one+(buffer) limit;
		buyflag = buy_level_one;
                Closed_Daily = CloseD(1);
                buy_level_one_counter = buy_level_one_counter [1] + 1;
	end;

Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > How do I enter at a broken level one time only?


December 9, 2019


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts