Semi-automatic trading - NinjaTrader Programming | futures io social day trading
futures io futures trading


Semi-automatic trading
Updated: Views / Replies:3,597 / 22
Created: by maxi 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
 

Semi-automatic trading

  #11 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


terratec View Post

So I use an indicator file (could also be a strategy), to have those declarations only once on my system and untouched for the day. In this file I just have the declarations of the variables, their standard values and some calculations like unrealized and realized P&L for all instruments etc.

I can confirm that this method is reliable and works well, for method calls as well as variables. For example, I have used the approach to implement ring buffered centralised and throttled log messages and sounds, as well as indicator crosstalk.

That said, I implement all my work as multi-instrument indicators, I stopped using strategies when N7 allowed it and I only do discretionary non-backtest/non curve fit stuff so can't comment on any strategy specific issues.

I know N7 charting runs on a single thread but I take good care in all my other-world code to use the 'lock' primitive etc where needed (otherwise cores will be cores when you least expect it.)

The approach is currently unsupported by NinjaTrader for good reasons, I'm not sure how they handle the support load for such an open product and such a wide audience as it is, so I would suggest for use only by experienced programmers. I have been astonished at what is possible inside this beast And maybe even more for N8? Cripes.

Travel Well
Reply With Quote
 
  #12 (permalink)
Trading Apprentice
Rome, Italy
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Equity Index Futures
 
Posts: 17 since Jul 2010
Thanks: 2 given, 0 received

terratec,

I see your point and I think the method is very reliable.
Nevertheless I start from a different perspective, having 3 lines on the chart for entry/SL/TP that I move until I find the good combination in terms of risk/reward, then I press the button and the entry order is placed (from the line on chart). At this time the indicator has already embedded the SL level and the TP level (from the lines on chart), but only when the order is executed, the SL and TP are placed on the market.

So the global variable stores the entry/exit points that are passed to the strategy. I do not understand how to use a third file to do this.

One more question on your method:

You keep opened just one chart, with one strategy and two indicators, one for trading layout with buttons and other stuff and another with the global variable, switching among markets just by selecting the chart scrollbar on the left?

Thanks.

Reply With Quote
 
  #13 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received



maxi View Post
monpere:
The strategy is interfaced through a Global variable from an indicator, which sends command (ex: "Buy" ) as well as entry level and SL and PT levels. Entry order (in stop) is entered on button pressing, while the exit levels are activated only "On Execution".

If I use a single chart, everything works as expected, but, adding a second chart (different market), on execution of the entry order, TP and SL are not activated.

Strategies are both attached to any of the 2 charts, so I wouldn't see any reason for not working properly.

My idea is that the manual order could generate a bit of confusion and probably the variable should be "restarded".

I've already done a similar code through ATM and it worked, but that's easier because one has to create an ATM for any of the markets. The pity is that I need to have the number of shares/lots variable and this cannot be done with ATM.

terratec:

interesting idea, although my levels need to be changed often. What do you mean with a third file? A new indicator?

Thanks to all.

I use indicator/strategy communication using global variables as well. I disassociate my strategies from indicators by starting the strategies in the Strategies Tab, and do not attach strategies to the charts. I start one strategy for each instrument I trade. I generally trade Oil, Gold and SPY, so I start a strategy for each in strategies tab, then I can bring up any chart I want, or no chart at all, that will not affect any of the strategies.

When I press a button on any chart it sends a text string command such as "SPY, SellLimit 250 @ 162.92 +12-162.98~0=8 @1S-5 @2S-4 @3S-3 @3S-3 @4S-2 @6T+5 @6S+3 _NoFillBars_2 _NoFillTicks_3". The first parameter 'SPY' identifies which strategy the command is sent to. In reality, all the running strategies get the same command, but Gold and Oil strategies realize that the command is not meant for them, so they ignore the command. The SPY strategy realize the command is meant for it, so it processes the command and sends a response back. Similarly, all charts running the indicator sees responses from all strategies, but the charts also know to ignore any responses that is not meant for them. This way every thing is decoupled, everyone sees all messages, and only act on their own messages.

The decoupling means I can click a button on the chart, start the trade, and close the chart. All trade related processing is handled by the strategy. The part of the command string "@10S-5..." is my ATM specification, each tell the strategy how to manage the trade, i.e @ 10 ticks profit move stop to Entry-5 ticks, etc. Trade statistics are already fully calculated by strategies so if I need trades stats, I send the command "CL, stats", and the strategy responds with a string containing all the statistics I want.

This is what my chart looks like. The indicator only processes button clicks (and position sizing) and sends commands to the strategy. The strategy processes all trade related functions and statistics, that's what it was designed for, and all the strategy code should be fully supportable by NT support.

Attached Thumbnails
Semi-automatic trading-cl.jpg  

Last edited by monpere; February 5th, 2013 at 10:59 AM.
Reply With Quote
The following user says Thank You to monpere for this post:
 
  #14 (permalink)
Trading Apprentice
Rome, Italy
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Equity Index Futures
 
Posts: 17 since Jul 2010
Thanks: 2 given, 0 received

monpere, but are you using the ATM strategy to manage the trade, so you have an ATM for each market to be addressed?

Because using ATM could solve the matter but you have the limitation that you cannot change the number of lots (let's say for instance a 2% risk on my equity on the next trade) without changing the ATM strategy every time.

Reply With Quote
 
  #15 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


maxi View Post
monpere, but are you using the ATM strategy to manage the trade, so you have an ATM for each market to be addressed?

Because using ATM could solve the matter but you have the limitation that you cannot change the number of lots (let's say for instance a 2% risk on my equity on the next trade) without changing the ATM strategy every time.

I don't use NT ATM strategies because they cannot do position sizing, and their functionality is limited, i.e only 3 conditions steps is allowed. I have a list of customized ATM's that can be chosen to manage any trade. If you look at my chart picture you will see a text field below the buttons, this is a drop down box with the specs for my various trade management types (customized ATM's text strings). I can choose a specific ATM in that drop down list, and the next time I send a trade command, that ATM spec will be sent along with the command. Near the top left corner of the chart you can see the full text of the currently chosen ATM command. Each "@..." entry in that text says @ x ticks profits do y. That includes move the target, or move the stop, or scale out, etc. I can have an unlimited number of these steps in the string. I had to do this because NT's ATM implementation is just too limited.

Attached Thumbnails
Semi-automatic trading-yy.jpg  

Last edited by monpere; February 5th, 2013 at 11:37 AM.
Reply With Quote
 
  #16 (permalink)
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 511 received


maxi View Post
One more question on your method:

You keep opened just one chart, with one strategy and two indicators, one for trading layout with buttons and other stuff and another with the global variable, switching among markets just by selecting the chart scrollbar on the left?

Thanks.

I am running one strategy for each instrument I intend to trade.
I can use one chart for all instruments by switching on the left side of the chart, or as many charts I want to use.
I can enter a trade in ES in the 5m timeframe, then go to CL placing an order there, switching to GC... going back to ES in a 3m timeframe and managing the trade.

To enter a trade I can use the method described, that is something like creating an ATM on the fly (as I dont like having 6 ATM's per instrument), or decoupling (detach button on the chart) the stuff and moving the black, red, and blue lines on the chart (post above) and then fire it.

As I said, I could place the code of the third file in the indy or strategy, but I have some advantages when changing timeframes etc. with using the third file.

Reply With Quote
 
  #17 (permalink)
Trading Apprentice
Rome, Italy
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Equity Index Futures
 
Posts: 17 since Jul 2010
Thanks: 2 given, 0 received

Thanks to all for the answers.

I will think about them to find a better way to cope with this matter.

Reply With Quote
 
  #18 (permalink)
Trading Apprentice
Rome, Italy
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Equity Index Futures
 
Posts: 17 since Jul 2010
Thanks: 2 given, 0 received

terratec, I've seen on the picture you attached that the orders are visible on chart. It seems you are not using Chart Trader but a simple strategy to enter/manage trades, so how can the orders be visible without using Chart Trader?

Am I missing something?

Thanks.

Reply With Quote
 
  #19 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,068 received


maxi View Post
terratec, I've seen on the picture you attached that the orders are visible on chart. It seems you are not using Chart Trader but a simple strategy to enter/manage trades, so how can the orders be visible without using Chart Trader?

Am I missing something?

Thanks.

Chart trader is active but the window is closed.

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

Reply With Quote
 
  #20 (permalink)
Elite Member
Zurich Switzerland
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES, 6E, CL
 
Posts: 404 since Sep 2009
Thanks: 64 given, 511 received



maxi View Post
terratec, I've seen on the picture you attached that the orders are visible on chart. It seems you are not using Chart Trader but a simple strategy to enter/manage trades, so how can the orders be visible without using Chart Trader?

Am I missing something?

Thanks.

maxi, to make it clear: my strategy is not linked to a chart.

I start all strategies in the tab. They are completely independent from charts. With the indicator on the chart (buttons) I send the commands, quantity, stops, targets etc. to the strategy of that instrument. And the strategy does send me infos back about account, P&L and whatever I want to know. In grosso modo it is the same way as described by monpere for his system a few post before.

And for your understanding (as I think my third file has some ??? for you):
The third file has not the function to store values. (As an extra it can do that). But it's job is to declare some variables.

NT does tolerate those declarations only once.
If I would do this in the strategy, I could not use the same strategy for different instruments at the same time. Same for the indicator in different charts at the same time.

When I would declare the variables in a chart, then values like highwater, total realized/unrealized would be reset every time when I switch the timeframe. That is also a reason that I place this indicator on a chart that I don't change during the day.


Last edited by terratec; February 6th, 2013 at 07:07 AM.
Reply With Quote

Reply



futures io > > > > > Semi-automatic trading

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
Using Multicharts on a virtual server for automatic trading arjfca MultiCharts 10 July 2nd, 2013 08:55 AM
What is the best trading platform for automatic strategy? banana Platforms and Indicators 6 December 9th, 2012 01:58 PM
Multicharts & Automatic Trading System Profitable bomberone1 Elite EasyLanguage Automated Trading 8 February 23rd, 2012 01:17 PM
Strategy SEMI AUTOMATED peter88 NinjaTrader Programming 1 January 25th, 2011 01:43 PM


All times are GMT -4. The time now is 01:26 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.17 seconds with 20 queries on phoenix via your IP 54.234.255.29