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 Fadi with 4 posts (0 thanks)
    3. looks_3 sam028 with 4 posts (2 thanks)
    4. looks_4 decs0057 with 1 posts (0 thanks)
    1. trending_up 7,836 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread
  #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?
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
CME Raises Energy Futures Margins After Iran-War Volatil …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,759 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,645

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)
Reply With Quote
  #3 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 484 since Apr 2012
Thanks Given: 667
Thanks Received: 649



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 X 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: 73 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: 484 since Apr 2012
Thanks Given: 667
Thanks Received: 649

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 X Reply With Quote
  #9 (permalink)
 
Fadi's Avatar
 Fadi 
Luxembourg
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB / Kinetick
Trading: ES, CL
Posts: 484 since Apr 2012
Thanks Given: 667
Thanks Received: 649

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 X Reply With Quote
  #10 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,759 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,645


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)
Reply With Quote




Last Updated on June 14, 2013


© 2026 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 - Downloads - Top
no new posts