Jump to content

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


kapri65

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...