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


buy order effective period
Updated: Views / Replies:1,709 / 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

  #11 (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, 854 received
Forum Reputation: Legendary

johni,

you will need different order names, I don't think there is a way around that. This would mean for you to create five different entry conditions and making sure the second one is only executed after the first has been filled etc.. Or have one entry condition with five different order parts, where the code would take the appropriate order according to which orders are already filled.

Regards,
ABCTG


johni View Post
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
The following user says Thank You to ABCTG for this post:
 
  #12 (permalink)
Trading Apprentice
canada
 
Futures Experience: Master
Platform: ts
Favorite Futures: stock
 
Posts: 29 since Jun 2011
Thanks: 0 given, 0 received

ABCTG,

Came out with this code to try the stoch buy signals but some of the signals are not registered

Whn stoch goes above 30 for some bars and fall below 30 the fall below 30 signals are all not registered

The code is fix and not dynamic to account of interval bars

Any idea how to tweak them? Did tried barnumber<count but didnot register those signals too

If Count1 = 0 and Count2 = 0 and Count3 = 0 and Stock < 30 then begin
Buy x shares this bar on close;
Count1 = BarNumber
end;

If Count1 <> 0 and BarNumber >= Count1 + 5 then begin
Sell X shares this bar on close;
Count1 = 0;
end;

If Count1 <> 0 and BarNumber = Count1 + 1 and Count2 = 0 and Stoch < 30 then Begin
Buy x shares this bar on close;
Count2 = BarNumber
end;

If Count2 <> 0 and BarNumber >= Count2 + 5 then begin
Sell X shares this bar on close;
Count2 = 0;
end;

Reply With Quote
 
  #13 (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, 854 received
Forum Reputation: Legendary


johni,

please post the whole code you are having problems with and wrap code tags around it in your post. It's hard to guess what is going wrong from this code piece only.

Regards,

ABCTG

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

ABCTG,

The code is below

Stoch may refer to stochastic

However this code is fix in a way that only 3 signals are accounted for and whn there are interval bar with stoch above 30 subsequent fall below 30 signals are not registered

Also if stoch is below 30 for 100 bars would not the user have to input 100 buy code to account for them?

Need a tweak? a loop or what?

================

Vars: Stoch(O), Count1(0), Count2(0), Count3(0) ;

If MarketPosition <= 0 then Begin
Count1 = 0;
Count2 = 0;
Count3 = 0;
end;

If Count1 = 0 and Count2 = 0 and Count3 = 0 and Stoch < 30 then begin
Buy x shares this bar on close;
Count1 = BarNumber
end;

If Count1 <> 0 and BarNumber >= Count1 + 5 then begin
Sell X shares this bar on close;
Count1 = 0;
end;

If Count1 <> 0 and BarNumber = Count1 + 1 and Count2 = 0 and Stoch < 30 then Begin
Buy x shares this bar on close;
Count2 = BarNumber
end;

If Count2 <> 0 and BarNumber >= Count2 + 5 then begin
Sell X shares this bar on close;
Count2 = 0;
end;

If Count1 <> 0 and Count2 <> 0 and Count3 = 0 and BarNumber = Count2 + 1 and Stoch < 30 then Begin
Buy x shares this bar on close;
Count3 = BarNumber
end;

If Count3 <> 0 and BarNumber >= Count3+ 5 then begin
Sell X shares this bar on close;
Count3 = 0;
end;

==============

Reply With Quote
 
  #15 (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, 854 received
Forum Reputation: Legendary

johni,

please check this post from this thread:
https://futures.io/easylanguage-programming/31261-buy-order-effective-period.html#post401286

You need to name the orders and tie the exits to the specific entry name. Then this will work:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Your original code without named orders produces this:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Regards,
ABCTG

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

ABCTG,

The second pic is exactly the problem

All the subsequent signals all exit on the same bar despite specifying the number of exit bar for each subsequent signal

Trying to code the first pic

But the problem is there is only one buy condition stoch<30 not like buy (H,1) or (H,2) which can be use to tie the exit to the entry How do you create 10 diff stoch<30? They are the same and result in same buy

Secondly if stoch is < 30 for 100 tims would not the user have to code them 100tims to account for the buy?

Reply With Quote
 
  #17 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received

Just had to give @ABCTG a few thanks in this thread, since I see that the thread starter did not show signs of appreciation for ABCTG's effort (either by saying thanks or pressing on the thanks button).

That's a shame, because people like ABCTG are volunteering their help on the forum while they have probably enough other things to do. Furthermore, it also limits getting help from other people, since not everyone is as patient and compassionate as ABCTG in this thread.

Reply With Quote
The following 3 users say Thank You to Jura for this post:
 
  #18 (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, 854 received
Forum Reputation: Legendary

Thanks @Jura, I really appreciate your comments.

@johni,

there is no need for (H, 1) or (H, 2) this was just an example. You can include order names to your code like this:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Regards,
ABCTG

Reply With Quote
The following 4 users say Thank You to ABCTG for this post:
 
  #19 (permalink)
Trading Apprentice
méxico df, méxico
 
Futures Experience: Advanced
Platform: ninjatrader, tradestation
Broker/Data: demo so far
Favorite Futures: stocks, fdax, fdxm, fesx, rb, ho, ng, cl, tf, nq, bp, ec, jy
 
Posts: 46 since Mar 2013
Thanks: 115 given, 21 received


johni View Post
ABCTG,

The code is below

Stoch may refer to stochastic

However this code is fix in a way that only 3 signals are accounted for and whn there are interval bar with stoch above 30 subsequent fall below 30 signals are not registered

Also if stoch is below 30 for 100 bars would not the user have to input 100 buy code to account for them?

Need a tweak? a loop or what?


ABCTG has shown amazing patience and helpfulness in this thread, danke schön.


now, if i understand correctly, you want to take x number of simultaneous long positions as long as the stochastic indicator is below some level, and x short positions when the stochastic indicator is above some level. also, each position must be held for a fixed number of bars and then closed.


one way to do it is to code x sets of entries and exits, which must be iterated one by one in the code. the other way i can think of, is to have just one set of entry and exit for long trades and one for short, and in - format strategies - go to the - properties for all - tab and allow up to x (100) positions in the same direction. i'm not sure the exits will work as desired, because when the strategy goes from long positions to short it will close all open long positions at once, and viceversa, but using this option the strategy will pyramid positions up to the specified number.

Reply With Quote
The following user says Thank You to maggtrading for this post:

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 05:12 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-14 in 0.13 seconds with 20 queries on phoenix via your IP 54.221.73.186