NexusFi: Find Your Edge


Home Menu

 





Strategy to exit manually entered trades?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Azrael with 5 posts (0 thanks)
    2. looks_two sam028 with 4 posts (2 thanks)
    3. looks_3 Fadi with 4 posts (0 thanks)
    4. looks_4 gulabv with 1 posts (0 thanks)
    1. trending_up 5,274 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread

Strategy to exit manually entered trades?

  #1 (permalink)
 Azrael 
Jurong Singapore
 
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks Given: 39
Thanks Received: 9

Hi guys

Was wondering, is it possible to script an exit only strategy for ninjatrader?

Say, once I manually entered a Long position, can it automatically queue an exit strategy for me at 20 ticks as Profit target and 10 ticks as Stop Loss from the close of the last bar?

Tried fooling around with the strategy wizard, but couldn't seem to get it done. =(

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Are there any eval firms that allow you to sink to your …
Traders Hideout
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
65 thanks
Funded Trader platforms
41 thanks
Battlestations: Show us your trading desks!
29 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
The Program
19 thanks

  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,824
Thanks Received: 4,629

Why not using an ATM? It was made for this.
If you want to enter manually and then have an exit only strategy, you will need to use unsupported and undocumented methods, so it's maybe not the good solution.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #3 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648



Azrael View Post
Hi guys

Was wondering, is it possible to script an exit only strategy for ninjatrader?

Say, once I manually entered a Long position, can it automatically queue an exit strategy for me at 20 ticks as Profit target and 10 ticks as Stop Loss from the close of the last bar?

Tried fooling around with the strategy wizard, but couldn't seem to get it done. =(

It is called ATM strategy

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Reply With Quote
  #4 (permalink)
 Azrael 
Jurong Singapore
 
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks Given: 39
Thanks Received: 9

Thanks for the replies guys

But my issue here is setting the PT and SL based on the close of the last bar. Not on my current entry point.

Could it be done? Or is it already done? 0_0

Started this thread Reply With Quote
  #5 (permalink)
 
gulabv's Avatar
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169

Use Close[1] to determine closing price of the last bar

Reply With Quote
  #6 (permalink)
 Azrael 
Jurong Singapore
 
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks Given: 39
Thanks Received: 9


gulabv View Post
Use Close[1] to determine closing price of the last bar

So that is for the Ninjatrader Strategy or ATM (at least I don't see how you can edit the ATM)? o_O

Started this thread Reply With Quote
  #7 (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

stop loss and target for ATM is based on entry price
It is not possible to set from Close of entry bar in ATM

To do this you have to use unsupported NT code

Reply With Quote
  #8 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648

I guess I now understand your request a bit better

Agree, you can't use the ATM for that, you will have to write a strategy that will check your position at the close of each bar.
Then if the position is not null; i.e. you already have an open position in your portfolio, the strategy runs a series of checks and decides whether you maintain or close that position.

Otherwise, if no positions are open, all the code is skipped and the algorithm waits for next bar's closure to run again.

Cheers
Fadi

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Reply With Quote
  #9 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 485 since Apr 2012
Thanks Given: 667
Thanks Received: 648

You can use something like this if you want:

if (position.MarketPosition == MarketPosition.Flat)
{
// Do something
}


if (position.MarketPosition == MarketPosition.Long)
{
// Do something
}


if (position.MarketPosition == MarketPosition.Short)
{
// Do something
}

Successful people will do what unsuccessful people won't or can't do!
Follow me on Twitter Reply With Quote
  #10 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,824
Thanks Received: 4,629


It won't work here, that will only show the position opened by the strategy itself, not the trades opened manually.



Fadi View Post
You can use something like this if you want:

if (position.MarketPosition == MarketPosition.Flat)
{
// Do something
}


if (position.MarketPosition == MarketPosition.Long)
{
// Do something
}


if (position.MarketPosition == MarketPosition.Short)
{
// Do something
}


Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote





Last Updated on June 14, 2013


© 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