NexusFi: Find Your Edge


Home Menu

 





Setting a static profit target


Discussion in NinjaTrader

Updated
    1. trending_up 4,780 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Setting a static profit target

  #1 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

Does anyone know of a way to have an exit signal based on the bar that caused the entry signal?

For example:
If the bar that caused the entry signal was size A (close minus open) then set the profit target equal to size B (open minus close * 2) of that specific bar though. That is the key, I have it so that it moves along looking at the last bar and doing that calculation, however, I need it to fix on the original bar.

Any ideas?
Thanks in advance

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #2 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

Forgetting my ninjascript, but maybe try something like,


target.Set(Position.MarketPosition = MarketPosition.Flat ? (math.abs(Open[0] - Close[0])*2)/TickSize : target[1]);
SetProfitTarget("LongSignal", CalculationMode.Ticks, target[0]);


Logic being the target will continually update until you enter a position, presumably at bar open, then target will keep referring to the prior target figure until the position is closed. Anyone feel free to correct me if that is wrong or better way to do it.

Reply With Quote
Thanked by:
  #3 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6


Apologies - this is quite a bit over my head at the moment. The scripts that I am writing are a lot simpler.
Do I replace the SetProfitTarget line with this? If so I am getting the following errors:

The name "math" does not exist
The name "target" does not exist

Or do I need to define the following terms somewhere?
Thank a lot for your help,
Todd

Started this thread Reply With Quote
  #4 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,233 since Jan 2011
Thanks Given: 6,775
Thanks Received: 18,203


toddma View Post
Does anyone know of a way to have an exit signal based on the bar that caused the entry signal?

For example:
If the bar that caused the entry signal was size A (close minus open) then set the profit target equal to size B (open minus close * 2) of that specific bar though. That is the key, I have it so that it moves along looking at the last bar and doing that calculation, however, I need it to fix on the original bar.

Any ideas?
Thanks in advance

A question on the logic: the market knows of no such thing as "bars" or "candles" -- so, why would you set your stop or profit target based on it?

Reply With Quote
  #5 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

The strategy is very short term in nature. It is only concerned with the most recent level of volatility and it should complete within 1-3 bars after the trade takes place (ideally). If we're in the middle of a strong move the target should be larger, if we're in a consolidation phase the target may be very small.

Started this thread Reply With Quote




Last Updated on July 31, 2012


© 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