Coding help - page 431

 
mladen:
I don't know. Try scanning it with some antivirus (avast and kaspersky were both detecting version 5 as malware)

I did no virus in it

thanks

 

Is it possible that someone can modify the attached indicator to display up and down arrows instead of histogram bars?? Any help would be appreciated.

Files:
 
daytrade5:
Is it possible that someone can modify the attached indicator to display up and down arrows instead of histogram bars?? Any help would be appreciated.

daytrade5

heiken ashi is by its nature a bar type of indicator. It includes high, low, open and close values for heiken ashi - making it show all that using just arrows would make it rather strange

 
mladen:
daytrade5 heiken ashi is by its nature a bar type of indicator. It includes high, low, open and close values for heiken ashi - making it show all that using just arrows would make it rather strange

Thanks Mladen,,,,,,,understood.

 
Hayk Gevorgyan:
Hi everyone,

can someone help me coding a simple ea based on xcode indicator, as I'm noob in coding.

just need buy and sell orders after signal bar close, indicator's signal period change option, trading hours and trading days change option.

buy and sell entry's are simple as described in screenshot. any timeframe any pair, take profit option, trailing stop option.

I know it's not the holy grail and is far from it (as holy grail doesn't exist ), but we can try to get something from this.

Also if it possible to add lot size increasing option (to change manually). for example: 0.01,0.01,0.02,0.02,0.04,0.04,0.08,0.08 and so on...

Anyone can do it?

Thanks.

 

Dear Mrtools/malden could you please check the code in below and tell where the mistake is?#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_width1 2

#property indicator_color2 Lime

#property indicator_width2 2

extern double lots = 0.1;

extern int SignalGap = 4;

int dist=24;

double b1[];

double b2[];

int err;

int ticket;

double stop;

double prof;

int init() {

SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);

SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);

SetIndexArrow(1,233);

SetIndexArrow(0,234);

SetIndexBuffer(0,b1);

SetIndexBuffer(1,b2);

return(0);

}

int deinit() { return(0); }

int start() {

int counted_bars=IndicatorCounted();

int k,i,j,limit,hhb,llb;

int TotalOrders = 0;

if (counted_bars<0) return(-1);

if (counted_bars>0) counted_bars--;

limit=Bars-1;

if(counted_bars>=1) limit=Bars-counted_bars-1;

if (limit<0) limit=0;

for (i=limit;i>=0;i--) {

hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);

llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);

if (i==hhb)

b1=High+SignalGap*Point;

if (i==llb)

b2=Low[llb]-SignalGap*Point;

for (int a=0; a <= OrdersTotal();a++)

if (OrderSelect(a,SELECT_BY_POS,MODE_TRADES))

if (OrderSymbol() == Symbol())

TotalOrders++;

if (TotalOrders<1)

{

double sl = stopsize*Point*MathPow(10,Digits%2);

double tp = profsize*Point*MathPow(10,Digits%2);

double ask=NormalizeDouble(Ask,Digits);

double bid=NormalizeDouble(Bid,Digits);

stop = (Ask-sl);

prof = (Ask+tp);

ticket = OrderSend(Symbol(), OP_BUY, Ask, 3, 0, 0, NULL,LimeGreen);

ticket = OrderSend(Symbol(), OP_SELL, Bid, 3, 0, 0, NULL,LimeGreen);

OrderModify( ticket, OrderOpenPrice(), stop, prof, 0, Blue);

}

err=GetLastError();

}

return(0);

}

 
hock87:
Dear Mrtools/malden could you please check the code in below and tell where the mistake is?#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_width1 2

#property indicator_color2 Lime

#property indicator_width2 2

extern double lots = 0.1;

extern int SignalGap = 4;

int dist=24;

double b1[];

double b2[];

int err;

int ticket;

double stop;

double prof;

int init() {

SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);

SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);

SetIndexArrow(1,233);

SetIndexArrow(0,234);

SetIndexBuffer(0,b1);

SetIndexBuffer(1,b2);

return(0);

}

int deinit() { return(0); }

int start() {

int counted_bars=IndicatorCounted();

int k,i,j,limit,hhb,llb;

int TotalOrders = 0;

if (counted_bars<0) return(-1);

if (counted_bars>0) counted_bars--;

limit=Bars-1;

if(counted_bars>=1) limit=Bars-counted_bars-1;

if (limit<0) limit=0;

for (i=limit;i>=0;i--) {

hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);

llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);

if (i==hhb)

b1=High+SignalGap*Point;

if (i==llb)

b2=Low[llb]-SignalGap*Point;

for (int a=0; a <= OrdersTotal();a++)

if (OrderSelect(a,SELECT_BY_POS,MODE_TRADES))

if (OrderSymbol() == Symbol())

TotalOrders++;

if (TotalOrders<1)

{

double sl = stopsize*Point*MathPow(10,Digits%2);

double tp = profsize*Point*MathPow(10,Digits%2);

double ask=NormalizeDouble(Ask,Digits);

double bid=NormalizeDouble(Bid,Digits);

stop = (Ask-sl);

prof = (Ask+tp);

ticket = OrderSend(Symbol(), OP_BUY, Ask, 3, 0, 0, NULL,LimeGreen);

ticket = OrderSend(Symbol(), OP_SELL, Bid, 3, 0, 0, NULL,LimeGreen);

OrderModify( ticket, OrderOpenPrice(), stop, prof, 0, Blue);

}

err=GetLastError();

}

return(0);

}

hock87

You can not handle orders from indicators

You have to call indicators from an EA using iCustom() to import the values that you want to test in the EA

____________________

PS: "xcode" is a renamed and decompiled bb stops indicator. There are already EAs built using that indicator. Just do a search on bb stop ea

 

Hi.

I dont know if it is already an indicator like this. But is it possible to make one indicator that prints arrows to the chart for multiple ocilliators?

Ex: Stochastics crosses signal line from either overbought or oversold (not if the cross is in middle of nowhere) another color arrow if Signal line cross MACD and an arrow when RSI enter AND exit either oversold or overbought.

The arrows should have different color to graphicly se which is which.

For extra if your a good coder with a little speartime a little table in the right lower corner with actual values for either.

Thanks

 
NWFstudent:
Hi.

I dont know if it is already an indicator like this. But is it possible to make one indicator that prints arrows to the chart for multiple ocilliators?

Ex: Stochastics crosses signal line from either overbought or oversold (not if the cross is in middle of nowhere) another color arrow if Signal line cross MACD and an arrow when RSI enter AND exit either oversold or overbought.

The arrows should have different color to graphicly se which is which.

For extra if your a good coder with a little speartime a little table in the right lower corner with actual values for either.

Thanks

Just the arrows signalling a condition without the actual ocsilliator on the chart.

 
NWFstudent:
Just the arrows signalling a condition without the actual ocsilliator on the chart.

NWFstudent

There is quite a few indicators tat do exactly that - so yes, it is posible

Reason: