Current contract - futures io
futures io futures trading



Current contract


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,050 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

Current contract

(login for full post details)
  #1 (permalink)
Como, Italy
 
Experience: Advanced
Platform: Tradestation, IB
Broker: Tradestation, IB
Trading: ES
 
Posts: 183 since Aug 2014
Thanks: 297 given, 312 received

Hello,

after a couple of months I'm running the strategy today happened that, I think due to several platform disconnections, the strategy continued to send to market closing orders like if it didn't recognize they already were sent before.
So at the end instead of find myself long 1 contract I was long 3 contracts with only 1 contract to close the position at target. (yes I was not there, it happened during the nigh and I was sleeping)

It's the first time it happens but platform disconected several times and I never had this kind of problem before...maybe is due to the fact I'm using the 9.5...

anyway in order to prevent such thing again I was thinking to use some kind of protection but I need help to code the variable...and even if figure out something I still have some doubt if can work...can you help?

vars : cont(0) ;


cont = currentcontract ....I should assign a value to this var consider I have no overnight positions.

if currentcontracts > 1 then begin
sell (currentcontract - cont) contract this bar at close ;
end;

Thanks for your help!

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
ZigZag with Depth and Backstep
EasyLanguage Programming
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


montanajtt,

you might want to look at the GetPositionQuantity reserved word. This will provide you with the position for a symbol and side (long/short) for the account of choice.
As TS says it might have some issues and is processor intensive, you might want to check the GetPosProvQty function. You can obtain it from the official forums.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #4 (permalink)
Como, Italy
 
Experience: Advanced
Platform: Tradestation, IB
Broker: Tradestation, IB
Trading: ES
 
Posts: 183 since Aug 2014
Thanks: 297 given, 312 received


ABCTG View Post
montanajtt,

you might want to look at the GetPositionQuantity reserved word. This will provide you with the position for a symbol and side (long/short) for the account of choice.
As TS says it might have some issues and is processor intensive, you might want to check the GetPosProvQty function. You can obtain it from the official forums.

Regards,
ABCTG


Hi ABCTG,

yes defenitely this can be a solution.

Thank you

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Current contract


Last Updated on August 7, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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