Buy/Sell in an indicator - NinjaTrader Programming | futures io social day trading
futures io futures trading


Buy/Sell in an indicator
Updated: Views / Replies:5,126 / 11
Created: by Mindset 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
 

Buy/Sell in an indicator

  #11 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

indicators and trading

success.

However there is bound to be a much more elegant way to do this - so if anyone does know of a way please let me know.


Essentially you need to throw your entryprice into the following command line
 
Code
entryorder = PLACE;SIM101;"+Instrument.FullName.ToString()+";SELL;
"+positionsize.ToString()+";STOPLIMIT;"+myentryprice.ToString()+";" 
+ myentryprice.ToString()+";DAY;;"+Instrument.FullName.ToString()+
"orderid;;";
and then
 
Code
File.AppendAllText(incomingpath,entryorder);
// nb  incrementing prevents locking which can happen with nos or multiple orders
where incomingpath = Cbi.Core.UserDataDir.ToString() + "\incoming\oif.txt";
This file is made and destroyed instantly and is better if you increment it for each order to prevent locking in cases of multiple orders hitting the file path simultaneously.


Now I am on to monitoring the outgoing file path for an oco order related to the entry!

Reply With Quote
 
  #12 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

oco orders thru oif

Ok bit further ahead now - it would help if I had taken a course in C# or even better Ninja Script - so forgive the messy way this is done.

setting oif's in indicators is fraught with little niggles

1. You have to send orders to the incoming folder whilst the position is "updated" - I use that term loosely - in the outgoing folder (My Documents -Nt 6.5)

2. I am reading the file in the outgoing folder and checking for when it doesn't say "FLAT" - eventually I will get it to look for long and short but lets walk first.

3.once that happens ( ie I am assuming I have a filled order - again partial fills are not catered for yet) - you can then send a straight oco order to the incoming folder in the format

PLACE;<ACCOUNT>;<INSTRUMENT>;<ACTION>;<QTY>;<ORDER TYPE>;[LIMIT PRICE];[STOP PRICE];<TIF>;[OCO ID];[ORDER ID];[STRATEGY];[STRATEGY ID]

 
Code
 stoporder = "PLACE;SIM101;"+symb()+";SELL;"+roundsizestr+";STOP;;"+stop+";DAY;"
+OCOID+";"+orderid+";;";  
File.AppendAllText(incomingpath",stoporder);	

tgtorder =  "PLACE;SIM101;"+symb()+";SELL;"+roundsizestr+";LIMIT;"+target+";;DAY;"
+OCOID+";"+orderid+";;"; 
File.AppendAllText(incomingpath+"3.txt",tgtorder);
I am only using this in sim so far as there are lots of holes but I am very pleased so far - I can now submit an order and place a stop and a target that are oco - its just annoying I can't use all the built in position code as it's all strategy based - unless someone can tell me otherwise...
btw is anyone finding this useful?

Reply With Quote

Reply



futures io > > > > > Buy/Sell in an indicator

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
Is it possible to show Buy/Sell strength in NT6.5? steveg NinjaTrader 1 March 15th, 2011 01:40 PM
MAMA with Buy Sell Signals and P&L ebtrader ThinkOrSwim Programming 2 December 11th, 2010 03:19 PM
Buy/sell Pressure indicator doesn't plot in mkt replay? emini_Holy_Grail Traders Hideout 2 September 18th, 2010 01:37 PM
[NinjaTrader]    buy sell chart jamfutures Platforms and Indicators 10 July 14th, 2010 08:36 PM
Buy Sell indicator based on traded volume, not price kronie The Elite Circle 6 November 21st, 2009 10:14 AM


All times are GMT -4. The time now is 03:05 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-16 in 0.08 seconds with 19 queries on phoenix via your IP 54.163.209.109