Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Help Please. How can I use the appearance of an arrow to call an order send function.


Recommended Posts

Posted

Help Please. How can I use the appearance of an arrow to call an order send function. ?? I am using a custom indicator.

 

OK. Here is the start of the indicator code.

 

All I need to do is enter a trade on the same bar as when the arrow first appears

 

############################

 

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_color2 Fuchsia

 

int gi_76 = 100;

int gi_80 = 75;

int gi_84 = 15;

double g_ibuf_88[];

double g_ibuf_92[];

int gi_96;

int gi_100;

 

int init() {

IndicatorBuffers(2);

SetIndexStyle(0, DRAW_ARROW);

SetIndexArrow(0, 233);

SetIndexStyle(1, DRAW_ARROW);

SetIndexArrow(1, 234);

SetIndexBuffer(0, g_ibuf_88);

SetIndexBuffer(1, g_ibuf_92);

SetIndexEmptyValue(0, 0.0);

return (0);

#################################}

 

How can I call the arrow as the trigger for Order Send.

 

I tried this code, and of course it trades all the time. It looks at the arrow value, and not at the bar when the arrow appeared

 

if iCustom(NULL,0,"Entry",0,0)<(Ask)..... OrderSend........

 

Thanks

Posted
Help Please. How can I use the appearance of an arrow to call an order send function. ?? I am using a custom indicator.

 

OK. Here is the start of the indicator code.

 

All I need to do is enter a trade on the same bar as when the arrow first appears

 

############################

 

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_color2 Fuchsia

 

int gi_76 = 100;

int gi_80 = 75;

int gi_84 = 15;

double g_ibuf_88[];

double g_ibuf_92[];

int gi_96;

int gi_100;

 

int init() {

IndicatorBuffers(2);

SetIndexStyle(0, DRAW_ARROW);

SetIndexArrow(0, 233);

SetIndexStyle(1, DRAW_ARROW);

SetIndexArrow(1, 234);

SetIndexBuffer(0, g_ibuf_88);

SetIndexBuffer(1, g_ibuf_92);

SetIndexEmptyValue(0, 0.0);

return (0);

#################################}

 

How can I call the arrow as the trigger for Order Send.

 

I tried this code, and of course it trades all the time. It looks at the arrow value, and not at the bar when the arrow appeared

 

if iCustom(NULL,0,"Entry",0,0)<(Ask)..... OrderSend........

 

Thanks

 

Without having the indy a bit hard to help but:

 

 

if (SetIndexBuffer(0, 0) >SetIndexBuffer(1, 0) ) Buy=true

if (SetIndexBuffer(1, 0) < SetIndexBuffer(0, 0) )Sell =true

 

this is not the proper code to call with Icustom but will give you some direction

 

Pheniox

Posted (edited)

I havent checked the indicator, but those buffers have values only when the arrows appear, one buffer for buy, one for sell so if the certain buffer value is higher than 0 buy or sell should be sent

iCustom(NULL,0,"Entry",0,1) >0 ..... OrderSend....(e.g.:OP_BUY)....

iCustom(NULL,0,"Entry",1,1) >0 ..... OrderSend....(e.g.:OP_SELL)....

...,1) ---> it depends on indicator but if repaints on last bar, better to wait to close that bar than do trade

Edited by konorti
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...