#property strict #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 White #property indicator_color2 Tomato #property indicator_color3 LimeGreen input double EntryPrice=0; input double StopPrice=0; input double RewardRisk=2.0; double Entry[],Stop[],Target[]; int OnInit(){IndicatorShortName("Chartara Risk Canvas");SetIndexBuffer(0,Entry);SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);SetIndexBuffer(1,Stop);SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);SetIndexBuffer(2,Target);SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2);return(INIT_SUCCEEDED);} int OnCalculate(const int n,const int p,const datetime& time[],const double& open[],const double& high[],const double& low[],const double& close[],const long& tv[],const long& vol[],const int& spread[]){double e=EntryPrice>0?EntryPrice:close[0],s=StopPrice>0?StopPrice:e-iATR(NULL,0,14,0),target=e+(e-s)*RewardRisk;int start=p==0?n-1:n-p;for(int i=start;i>=0;i--){Entry[i]=e;Stop[i]=s;Target[i]=target;}return(n);}