Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
What I am trying to do in plain English is make the ATR profit target " dynamic " by
" incrementalizing " it. See code snippett below :
So, currently mFactor A / B = static values. Which means they have a stationary value based on whether or not the ATR value is above or below the benchmark value of .25. The ATR value is determined by the price, so as price goes up or down the ATR value will change correspondingly in turn causing the mFactor to change BUT ONLY if it goes ABOVE or goes BELOW the .25 value. What I am attempting to do is have the mFactor change ( increment or de increment if you will ) along with the change in the ATR value.
So, let's say for every five points of the declining ATR value the mFactor increases by 1 point. Or for every one point of ATR decline the mFactor increases by one point....hopefully this make sense.
mFactorA = ATR(14)[0];
mFactorB = ATR(14)[0];
if (mFactorA > .25 + + // AS THIS .25 VALUE INCREMENTS BY ONE
&& Open[0] <= ATRPREDICTOR2(2, 10, 3).Upper[0]
&& High[3] > High[2] // SHORT
&& High[2] > High[1])
if (mFactorB < .25 - - // AS THIS .25 VALUE DE INCREMENTS BY ONE
&& Open[0] <= ATRPREDICTOR2(2, 10, 3).Upper[0]
&& High[3] > High[2] // SHORT
&& High[2] > High[1])
{
EnterShort(DefaultQuantity, "Condition 7A Entry");
DrawDiamond("Sell Order Diamond # 7" + CurrentBar, true, 0, High[0] + 75 * TickSize, Color.Green);
mFactorA=((ATR(14)[0]/TickSize)* - - 2 ); // THEN THE 2 VALUE DE INCREMENTS BY ONE
SetProfitTarget("Condition 7A Entry", CalculationMode.Ticks,mFactorA);
}
{
EnterShort(DefaultQuantity, "Condition 7B Entry");
DrawDiamond("Sell Order Diamond # 7" + CurrentBar, true, 0, High[0] + 75 * TickSize, Color.PaleGreen);
mFactorB=((ATR(14)[0]/TickSize)* + + 3 ); // THEN THE 3 VALUE INCREMENTS BY ONE
SetProfitTarget("Condition 7B Entry", CalculationMode.Ticks,mFactorB);
}
Thanks,
Richard
Can you help answer these questions from other members on NexusFi?
Again, thanks for your reply. Could you offer an example ? A link, a document, any other resources ? I have been researching random walk with drift theory, maximal curves, continuous stochastic processes, measure & integration, probabilities and discrete intervals in an attempt to find a way to achieve my goal here of having a dynamic stop loss and dynamic profit target. The one I currently use is somewhat dynamic but it could be much better. My goal is to have my stop loss and profit target "move and calculate" with the recent past ( say, the past 30 - 15 minute bars ) as well as the current price. I am basically trying to calculate volatility on a minute by minute basis and adjust my stop loss and profit target accordingly......say, in 15 minute intervals, if that happens to be the time frame that I am trading from.