EL question--need help intraday programming - EasyLanguage Programming | futures io social day trading
futures io futures trading


EL question--need help intraday programming
Updated: Views / Replies:815 / 5
Created: by jschultzjr Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

EL question--need help intraday programming

  #1 (permalink)
Trading Apprentice
new york, ny
 
Futures Experience: Intermediate
Platform: tradestation
Favorite Futures: stocks
 
Posts: 2 since Sep 2013
Thanks: 1 given, 0 received

EL question--need help intraday programming

Is there a way to make an intraday strategy execute just one time? In other words, say you have a strategy.... it executes, then later it closes the position.....I want to make sure it doesn't execute again...one execution per day then strategy shuts down. Any thoughts?

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary


You could monitor the number of trades and block additional trades for the day when a new trade happens.

You could also use a true/false variable that you use as a flag. When you enter a trade you set this variable to false and reset it on a date change.

 
Code
if Date <> Date[1] then
TradingAllowed = true;


if TradingAllowed and your other entry conditions are matched then
begin
 Take a trade
TradingAllowed = false;
end;
You might need to change the position where you set the flag to false, to something like
 
Code
if MarketPosition <> 0 then TradingAllowed = false;
Something like the above should get you started.

Regards,
ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
new york, ny
 
Futures Experience: Intermediate
Platform: tradestation
Favorite Futures: stocks
 
Posts: 2 since Sep 2013
Thanks: 1 given, 0 received

Thanks, but still a problem

ABCTG,

Thanks for help and reply.

The problem I am running into still is that the strategy is missing trades that it should be taking. The problem may be that I am using hourly charts....? Is there any other way to know when a new day has arrived so I can reset the flag?

Using stock tradestation new low function:


 
Code
[IntrabarOrderGeneration = false]

inputs: int PeriodType( 1 ) ;
{ pass in 1 for chart, 2 for day, 3 for week, 4 for month, 5 for year }

variables: 
	int BT( BarType ),
	int tradecount ( 0 ),
	bool TradingallowedL ( true ),
	bool LastBarOfPeriod( false ), 
	double LowestLo( -1000000 ), { LowestLo is initialized to a large -ve value to 
	 ensure that if a calendar period is specified, the first such period on the 
	 chart is ignored because it may be incomplete }
	bool IsDailyBarOrShorter( false ),
	bool IsWeeklyBarOrShorter( false ),
	bool IsMonthBarOrShorter( false ),
	bool NextBarIsNewDay( false ),
	bool NextBarIsNewWeek( false ),
	bool NextBarIsNewMonth( false ),
	bool NextBarIsNewYear( false ) ;
		
If date<>date[1] then tradingallowedl=true;


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 Low < LowestLo 
then
	LowestLo = Low ;
	
	
	
  if LastBarOfPeriod = false and tradingallowedl=true then
  begin
	Sell Short( "NewLo" ) next at bar at LowestLo - 1 point stop ;
	tradingallowedl=false;
    end;


The Red parts above it what I added to the stock new lo from tradestation....just using a simple % pair to exit...

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

jschultzjr,

you are welcome. Can you show some examples of missed trades and explain why you would expect a trade at these points?

Regards,
ABCTG

Reply With Quote
 
  #6 (permalink)
Elite Member
Colorado
 
Futures Experience: Advanced
Platform: MultiCharts
Broker/Data: IB & Iqfeed
Favorite Futures: ES , CL
 
sptrader's Avatar
 
Posts: 533 since Apr 2010
Thanks: 1,080 given, 668 received


jschultzjr View Post
Is there a way to make an intraday strategy execute just one time? In other words, say you have a strategy.... it executes, then later it closes the position.....I want to make sure it doesn't execute again...one execution per day then strategy shuts down. Any thoughts?

***************************************************************
Tradestation has a Function called "Tradestoday", so all you have to do is add the following:
if Tradestoday(date) = 0 then begin

Reply With Quote

Reply



futures io > > > > > EL question--need help intraday programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Programming (programming without coding) LukeGeniol Platforms and Indicators 11 September 16th, 2016 01:49 PM
ThinkScript (TOS) Programming Question Curbfeeler ThinkOrSwim Programming 10 March 8th, 2016 04:19 PM
NT Programming Question - Avoiding Re-entry? Fibbee NinjaTrader 5 January 11th, 2013 04:49 AM
Learning EL. Question Timot EasyLanguage Programming 13 May 12th, 2012 10:41 AM
Classical Momentum indicator variation - EL study question Laurus12 EasyLanguage Programming 3 April 10th, 2011 02:30 PM


All times are GMT -4. The time now is 08:34 PM.

Copyright © 2017 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
Page generated 2017-12-10 in 0.10 seconds with 19 queries on phoenix via your IP 54.83.122.227