NexusFi: Find Your Edge


Home Menu

 





Calling on Advanced C# Ninja Coders -- to finish ClickTrade


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 21 posts (2 thanks)
    2. looks_two decs0057 with 4 posts (3 thanks)
    3. looks_3 Mindset with 3 posts (1 thanks)
    4. looks_4 steve2222 with 2 posts (0 thanks)
    1. trending_up 12,327 views
    2. thumb_up 6 thanks given
    3. group 9 followers
    1. forum 37 posts
    2. attach_file 2 attachments




 
Search this Thread

Calling on Advanced C# Ninja Coders -- to finish ClickTrade

  #1 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

I'm trying to finish a NinjaTrader "ClickTrader" indicator, for scalpers, that lets me enter an order at the click point, with just one mouse click, and also exit any position and/or pending order when the Space key is pressed.

I have the skeleton complete and working (see attachment)

BUT I'm having trouble with the trade interface. I have used OIF files in the past but would prefer not.

I would like to use NTDirect.dll or NinjaTrader.Client.

But I am not sure how to get them linked into the indicator. I'm unable to reference NinjaTrader.Client. It appears to have conflicts with other Ninja DLLs. (So far no resolution on the NT forum)

I've looked at indicator code in futures.io (formerly BMT) that submits orders but I don't understand how either NTDirect or NinjaTrader.Client are bound to the indicator, and how to call them.

If someone can help me with this part I will put the finished indicator on futures.io (formerly BMT).

Here is what it should do:

Left Mouse + Shift = Submit a Long ATM order at the clicked price
Left Mouse + Control = Submit a Short ATM order at the clicked price
Space Bar = CLOSE ALL POSITIONS FOR THIS INSTRUMENT AND CANCEL ANY PENDING ORDERS

Well, I would like to finish this if possible.

The debugging code is all there (print statements) to verify the execution.

Thank you!!

ClickTrade.zip

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387


did you look in the elite downloads, there is at least 1 chart trader indi/application

Reply With Quote
  #4 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Yes, I did, and I read the code but did not see how the linking is made, as mentioned.

Started this thread Reply With Quote
  #5 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

Conflict between [AUTOLINK]NinjaTrader[/AUTOLINK].Core.dll and [AUTOLINK]NinjaTrader[/AUTOLINK].Client.dll - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Started this thread Reply With Quote
  #6 (permalink)
 askerix 
Zurich Switzerland
 
Experience: None
Platform: NT
Trading: Ukulele
Frequency: Never
Duration: Never
Posts: 60 since Mar 2011
Thanks Given: 554
Thanks Received: 62

Hi vantojo

you can't access the ATM strategy feature (and Methods) without being in the strategy namespace - which isn't usable alongside the charttrader.
To enter orders from an indicator, you have to use the order method from the account object which is a complete unmanaged order.
You can find an example here:
It's possible to track the order and send SL and TP orders after fills - but everthing must be done by yourself.

the other possibility is to exchange your entry information between your indicator and a background strategy running on a different chart window, by a gobal static object or some other kind of exchange function (some use files).

Reply With Quote
  #7 (permalink)
 steve2222 
Auckland, New Zealand
 
Experience: Beginner
Platform: Sierra Chart
Broker: AMP/CQG
Trading: Whatever moves in my timezone
Posts: 1,896 since Sep 2009
Thanks Given: 3,379
Thanks Received: 1,540

I am not a programmer, but can you not use AutoHotKeys?





I use this for my order entry and exits. I adapted a couple of the scripts from the linked threads and they work fine.

You can basically write script to do anything you can do on the keyboard or mouse, including accessing ChartTrader functionality.

Reply With Quote
  #8 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


askerix View Post
Hi vantojo

you can't access the ATM strategy feature (and Methods) without being in the strategy namespace - which isn't usable alongside the charttrader.

Actually, I have a third party paid software called ClickTrader that does exactly what I'm trying to do, so there must be some way to accomplish it.

And I have used OIF files from an indicator to close positions and that works well.

My preference is to only have software I write running inside NinjaTrader, so that if a vender disappears my trading is not impacted. Also, if there is a bug I can fix it, or if I want a new feature I can do it myself without a petition to the developer.

I have read the indicator you mention, ChartTraderIndicator, but do not see how it is linking to an order engine...I only see this

Order o = a.CreateOrder(Instrument,OrderAction.Buy,OrderType.Limit,TimeInForce.Day,quantity, (double)nudBuyLmtPr.Value,0,"","Buy");
o.Submit();

but have no idea where the methods CreateOrder and Submit are hosted. They are not Ninja commands, and there is no entry in the declaratives, it seems.

Perhaps I need another title to this thread....

Started this thread Reply With Quote
  #9 (permalink)
 decs0057 
Munich, Germany
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Broker: IB, NinjaTrader Brokerage
Trading: ES,NQ,6E
Posts: 71 since Feb 2010
Thanks Given: 15
Thanks Received: 25

Order o = a.CreateOrder(Instrument,OrderAction.Buy,OrderType.Limit,TimeInForce.Day,quantity, (double)nudBuyLmtPr.Value,0,"","Buy");
o.Submit();

is undocumented NT functionality, this will send order but ATM is not attached

Reply With Quote
  #10 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012



steve2222 View Post
I am not a programmer, but can you not use AutoHotKeys?

functionality.

I have an external hot key manager I use a lot and is great. HotKeyBoard. Very useful. I use it for all sorts of things like clearing drawn objects with one key combo, changing chart preferences, et cetera.

But it has no ability to know what the price is at a mouse click then submit an order.

I use the Ninja Hotkeys also, but I don't see that it can either know the price at a mouse click.

Can the Ninja Hotkeys know the price at a click on Charttrader?

Started this thread Reply With Quote




Last Updated on February 5, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts