# Need to Plot ATP ( Average Traded Price ) on the Graph

#### Kumar2409

##### Member
Hi Seniors and Members ,

Need help of the above topic i.e.,

AFL needed for ATP price to be plotted on the graph .

Also need Buy and Sell signal with ATP price ...

If price closes above ATP price its a BUY . and..

If price closes below ATP price its a SELL ..

Kumar

#### sharatlic

##### Member
Mr.Kumar

I am having only ATP afl, any seniors can add buy n sell signals

_SECTION_BEGIN("ATP");
B=Volume;
A=Avg;
Value=B*A;
Barsfromtodaybegin = 1 + BarsSince( Day() != Ref(Day(), -1));
Totalvalue=Sum(Value,Barsfromtodaybegin);
Totalvolume=Sum(V,Barsfromtodaybegin);
ATP=(Totalvalue/Totalvolume);
ColorATP=IIf(ATP>Ref(ATP,-1),colorBrightGreen,colorRed);
Plot(ATP,"ATP",colorATP,styleThick);
_SECTION_END();

#### casoni

##### Well-Known Member
Mr.Kumar

I am having only ATP afl, any seniors can add buy n sell signals

_SECTION_BEGIN("ATP");
B=Volume;
A=Avg;
Value=B*A;
Barsfromtodaybegin = 1 + BarsSince( Day() != Ref(Day(), -1));
Totalvalue=Sum(Value,Barsfromtodaybegin);
Totalvolume=Sum(V,Barsfromtodaybegin);
ATP=(Totalvalue/Totalvolume);
ColorATP=IIf(ATP>Ref(ATP,-1),colorBrightGreen,colorRed);
Plot(ATP,"ATP",colorATP,styleThick);
_SECTION_END();

plot(c,"",3,64);
Sell=Cross(atp,C);
PlotShapes(shapeDownArrow*Sell,4,0,H,-10);

##### MM is the holy grail
Mr.Kumar

I am having only ATP afl, any seniors can add buy n sell signals

_SECTION_BEGIN("ATP");
B=Volume;
A=Avg;
Value=B*A;
Barsfromtodaybegin = 1 + BarsSince( Day() != Ref(Day(), -1));
Totalvalue=Sum(Value,Barsfromtodaybegin);
Totalvolume=Sum(V,Barsfromtodaybegin);
ATP=(Totalvalue/Totalvolume);
ColorATP=IIf(ATP>Ref(ATP,-1),colorBrightGreen,colorRed);
Plot(ATP,"ATP",colorATP,styleThick);
_SECTION_END();
thanks for ATP AFL........:thumb:

#### Kumar2409

##### Member
Thank you sharatlic and Mr.Casoni

#### fxgood

##### Well-Known Member
If trade using ATP and buy above and sell below , account will be dead by its whip saw very soon

#### Kumar2409

##### Member
two more ways to use this :thumb:

For reducing whipsaws, can introduce a lag to the signal by using MA of C.
Code:
``````plot(c,"",3,64);
Sell=Cross(atp,MA(C,6));
PlotShapes(shapeDownArrow*Sell,4,0,H,-10);``````
Another way to introduce Lag, is to wait for the full bar to be above/below ATP Line
Code:
``````plot(c,"",3,64);
Sell=Cross(atp,H);
PlotShapes(shapeDownArrow*Sell,4,0,H,-10);``````

Thanks:thumb:

Thank you sir.. SO here you are using MA of 6 days... any reason for 6 days??

#### VJAY

##### Well-Known Member
If trade using ATP and buy above and sell below , account will be dead by its whip saw very soon

#### p.rahulganesh

##### New Member

plot(c,"",3,64);
Sell=Cross(atp,C);