Counting Orders - futures io
futures io futures trading



Counting Orders


Discussion in EasyLanguage Programming

Updated by ABCTG
    1. trending_up 323 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 4 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
 

Counting Orders

(login for full post details)
  #1 (permalink)
Porto Portugal
 
 
Posts: 8 since May 2018
Thanks: 0 given, 0 received

I would like to set a simple code to place up to 5 orders sequencially, not in the same bar but the number of orders would be a changeable input, that is, a range of maximum orders could be defined.
I designed the code below but it doesnt work nor does any counting...Can someone help me on this?
Thanks

Inputs:
Price( Close ), PositionBasis( False ),Entrysize (1000),
Ci(12),
ptsROC(0.5), MaxROC(3) ;

variables:
EntryCondition1(false),

CountROC (0);

EntryCondition1= Close > Ci ;

if MarketPosition = 0 then begin
CountROC = 0 ;
end ;

if CurrentBar > 1 then begin


if EntryCondition1 then
Switch( CurrentContracts )
begin
Case 0:
Buy ("MACDLE1") this bar at Close;
if CountROC < MaxROC then
begin
CountROC += 1 ;
end;
Buy ("MACDLE2") this bar at Close;
if CountROC < MaxROC then
begin
CountROC += 1 ;
end;
Case EntrySize*2:
Buy ("MACDLE3") this bar at Close;
if CountROC < MaxROC then
begin
CountROC += 1 ;
end;
Case EntrySize*3:
Buy ("MACDLE4") this bar at Close;
if CountROC < MaxROC then
begin
CountROC += 1 ;
end;
Case EntrySize*4:
Buy ("MACDLE5") this bar at Close;
end;
end;


sell ("MACDLX1") from entry ("MACDLE1") next bar AT$ Close + PTSroc Limit ;
sell ("MACDLX2") from entry ("MACDLE2") next bar AT$ Close + PTSroc Limit ;
sell ("MACDLX3") from entry ("MACDLE3") next bar AT$ Close + PTSroc Limit ;
sell ("MACDLX4") from entry ("MACDLE4") next bar AT$ Close + PTSroc Limit ;
sell ("MACDLX5") from entry ("MACDLE5") next bar AT$ Close + PTSroc Limit ;

Reply With Quote

Can you help answer these questions
from other members on futures io?
Price Down, Volume Up, Open Interest Down
Traders Hideout
IB Bracker Order
Platforms and Indicators
help to convert from thinkscript to ninjascript
NinjaTrader
Where is the link to download GomiRecorder?
NinjaTrader
Fundamental question on index trading
Emini and Emicro Index
 
 
(login for full post details)
  #3 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,192 since Apr 2013
Thanks: 385 given, 1,427 received


tradestation18,

I would suggest using the Print statements to find out if certain parts are executed. Check if the entry conditions are fulfilled at all.
When you say "doesn't work" what does the code do versus what do you want it to do?

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
Porto Portugal
 
 
Posts: 8 since May 2018
Thanks: 0 given, 0 received

Thanks. The code doesnt work because the supposed counting of entry orders simply doesnt work. There is no counting. I would like to limit the number of entries for each EntryCondition, but this routine doesnt seem to count anyway...

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,192 since Apr 2013
Thanks: 385 given, 1,427 received

tradestation18,

what do the print statements show, does the code cycle through all parts?

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Counting Orders


September 27, 2018


Upcoming Webinars and Events
 

Getting Comfortable with Price Action Patterns w/Earn2Trade

Aug 4
 

Live Video Panel: Ask Me Anything w/Ironbeam Brokerage

Aug 6
     



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