buy order effective period - EasyLanguage Programming | futures io social day trading
futures io futures trading


buy order effective period
Updated: Views / Replies:1,713 / 18
Created: by johni Attachments:3

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
 3  
 
Thread Tools Search this Thread
 

buy order effective period

  #1 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received

buy order effective period

How to code a buy order in effect for the next 15 bars?

Say close is > ema and once satified buy at c-atr limit for the next 15 bars rather for the next bar

The buy price does not change

If next bar c-atr buy price is lower is consider another signal for the next 15 bars


Last edited by johni; April 5th, 2014 at 09:43 AM.
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,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


johni,

something like this could do it. Basically you'd have to store the bar number at the time you send the order and as long as the current bar number is smaller than the saved one + 15 you are good to take the trade.
This is the pseudo code for doing that:

 
Code
if close > ema vakue and LongOrderSent = false then
begin
       LongOrderSent = true;
       MyCurrentBar = CurrentBar + 15;
       LongEntryPrice = c-atr;
end;

if CurrentBar <= MyCurrentBar  then
    Buy ("Long") next bar LongEntryPrice limit;

//reset the order sent flag
if CurrentBar > MyCurrentBar or MarketPosition > 1 then
   LongOrderSent = false;
Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received

ABCTG,

input your code and add a exit using number of bars like 6 bars from entry but multiple entries exit on the same bar of first signal rather 6 bars from entry

say c<ema and bar 0 1 2 3 all are c<ema and are valid entries

signal 0 should exit at 6 bars and signal 1 should exit at bar 7 signal 2 should exit at bar 8 but instead all the signals exit together at bar 6

how to ensure all signal each exit 6 bars from entry?


Last edited by johni; April 5th, 2014 at 02:52 PM.
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,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

johni,

your original request was for a order being active for X bars. You reply now suggest you are actually looking for something different i.e. a trade being closed after X bars. Maybe you can elaborate on what you are exactly looking for and I (or other) would be able to much better help you.

Regards,
ABCTG

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received

Want to have each signal exit at x bars

The signal would be from the condition which is valid for next 15 bars

Say for c<ema15 is the signal and bar 0 there is a signal the exit would be on next x bars

if on bar 1 c is still < ema15 this would be a second signal and would exit on the next x bars counting from the second signal bar NOT on the first signal entry bar

The second third signals would buy despite first signal has not exited

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

johni,
this is an example taken from the Tradestation forum, showing how you can tie an exit to a specific entry.
This will be something you need to do as well in your code.

 
Code
Buy ("LE.Sys1" ) next bar at Highest(H,1) stop ; 
Buy ("LE.Sys2" ) next bar at Highest(H,2) stop ; 
Buy ("LE.Sys3" ) next bar at Highest(H,3) stop ; 
Buy ("LE.Sys4" ) next bar at Highest(H,4) stop ; 
Buy ("LE.Sys5" ) next bar at Highest(H,5) stop ; 
Buy ("LE.Sys6" ) next bar at Highest(H,6) stop ; 
 
 
Sell("LX.Sys1") from entry ("LE.Sys1") next bar at Lowest(L,6) stop; 
Sell("LX.Sys2") from entry ("LE.Sys2") next bar at Lowest(L,5) stop; 
Sell("LX.Sys3") from entry ("LE.Sys3") next bar at Lowest(L,4) stop; 
Sell("LX.Sys4") from entry ("LE.Sys4") next bar at Lowest(L,3) stop; 
Sell("LX.Sys5") from entry ("LE.Sys5") next bar at Lowest(L,2) stop; 
Sell("LX.Sys6") from entry ("LE.Sys6") next bar at Lowest(L,1) stop;
Regards,
ABCTG

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received

Did try the from entry code but the problem is if the signal condition is valid for more than the number of buy code you specified they may not be accounted for

Is there a loop code to ensure all signals are accounted for?

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

You need to adapt the code to the number of entries you are taking of course. This was just an example to get you going.
As orders can't be within a loop you will probably have to hard code all entries and exits.

Regards,
ABCTG

Reply With Quote
 
  #10 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received


ABCTG,

The signals are considered different

Buying at Highest(H,1) and Highest(H,2) are different signals thus require from entry to tag them

However the problem is having similar signals with exiting filled order

Say buy whn stoch<30 and today there is a buy signal (stoch<30) and tomorrow stoch is still <30 so there is another buy similar signal with existing signal filled (yesterday)

Want to have each buy (similar signal) exit 5 bars from the entry

So today buy signal would tmr exit 5 bars from today but tmr buy signal would exit 5 bars from tmr not today

Reply With Quote

Reply



futures io > > > > > buy order effective period

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which typ of order I need to buy or sell at the Last Price (Chart Price) TraderMaze Emini Index Futures Trading 8 April 22nd, 2014 09:25 AM
Can the market see if your order is a buy or sell and are algos able to track ATMs? aventeren The Elite Circle 3 August 7th, 2013 06:27 PM
automated buy order on specific size bar close ncsutrader Elite Automated NinjaTrader Trading 3 May 27th, 2013 11:24 AM
Is the best way to place a buy limit order by using DOM shots fired ThinkOrSwim 13 April 26th, 2013 06:31 PM
Effective risk sefstrat Psychology and Money Management 5 October 17th, 2009 12:37 PM


All times are GMT -4. The time now is 01:28 AM.

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-16 in 0.11 seconds with 20 queries on phoenix via your IP 23.22.136.56