Hello I would like to know if someone could give me a hand .. I am not a programmer but sometimes I like to play with codes .. to the subject .. I have a script that its function is: when adding it to the graph it adds a fibonacci retracement but modified with risk reward .. I would like to know if you can make an EA that when taking an order this case "sell" add this fibonacci automatically I leave the code .. who can help me I appreciate it very much!
When an order is taken a fibonacci is dropped with the TP parameter as the (+300 points)?
When an order is taken a fibonacci is dropped with the TP parameter as the (+300 points)?
it is correct when adding the script take the stop loss 30 pips "300 point" then 1: 1 = 30 pips, 2: 1 = 60pips and so on until 4: 1 my intention is that when pressing the sell button the EA draws the fibonacci as the script does.
Example if I were taking a "sell" the EA place the fibonacci like this
images : https://ibb.co/BjsX3qq
it is correct when adding the script take the stop loss 30 pips "300 point" then 1: 1 = 30 pips, 2: 1 = 60pips and so on until 4: 1 my intention is that when pressing the sell button the EA draws the fibonacci as the script does.
Example if I were taking a "sell" the EA place the fibonacci like this
images : https://ibb.co/BjsX3qq
Aha . Try this
#property version "1.00" #property strict string system_tag="Test_"; int OnInit() { DrawOrderFiboNotRealFibo(OP_BUY,1,Open[0],Time[0],400,3,10,system_tag); return(INIT_SUCCEEDED); } //FUNCTION TO PORT void DrawOrderFiboNotRealFibo(ENUM_ORDER_TYPE direction, int order_ticket, double open_price, datetime open_time, double stop_loss_points, int levels, int bars_time_forward, string system_tags){ string object_name=system_tags+"_"+IntegerToString(order_ticket); double sl_price=open_price; if(direction==OP_BUY){sl_price-=(stop_loss_points*Point());} if(direction==OP_SELL){sl_price+=(stop_loss_points*Point());} sl_price=NormalizeDouble(sl_price,Digits()); datetime forwardtime=(datetime)(Time[0]+bars_time_forward*PeriodSeconds()); bool obji=ObjectCreate(ChartID(),object_name,OBJ_FIBO,0,open_time,open_price,forwardtime,sl_price); if(obji){ ObjectSetInteger(ChartID(),object_name,OBJPROP_LEVELS,levels+2); //0 sl ObjectSetString(ChartID(),object_name,OBJPROP_LEVELTEXT,0,"StopLoss"); ObjectSetDouble(ChartID(),object_name,OBJPROP_LEVELVALUE,0,0.0); //1 op ObjectSetString(ChartID(),object_name,OBJPROP_LEVELTEXT,1,"OpenPrice"); ObjectSetDouble(ChartID(),object_name,OBJPROP_LEVELVALUE,1,1.0); //ObjectSetDouble(ChartID(),object_name,OBJPROP_ ObjectSetDouble(ChartID(),object_name,OBJPROP_PRICE1,open_price); ObjectSetDouble(ChartID(),object_name,OBJPROP_PRICE2,sl_price); //... double lvl=1.0; int reward=0; for(int l=0;l<levels;l++){ reward++; lvl+=1.0; ObjectSetString(ChartID(),object_name,OBJPROP_LEVELTEXT,l+2,"TP 1:"+IntegerToString(reward)); ObjectSetDouble(ChartID(),object_name,OBJPROP_LEVELVALUE,l+2,lvl); } } } void OnDeinit(const int reason) { ObjectsDeleteAll(ChartID(),system_tag); } void OnTick(){}
Aha . Try this
Thank you very much for your help, but it still does not do what I need .. it's ok to add the EA add the fibonacci ... but I would like you to add it only when taking an order,
I really appreciate your help
Thank you very much for your help, but it still does not do what I need .. it's ok to add the EA add the fibonacci ... but I would like you to add it only when taking an order,
I really appreciate your help
You can call the function in your EA when an order is sent and it will draw it .
I don't understand much .. I'm not a programmer :(
I thought you had an EA to which you wanted to add this when it placed trades.
I thought you had an EA to which you wanted to add this when it placed trades.
Not the code that I put is a script so I wanted to pass it to EA .. I don't have EA :(
Not the code that I put is a script so I wanted to pass it to EA .. I don't have EA :(
And how would the EA trade though?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello I would like to know if someone could give me a hand .. I am not a programmer but sometimes I like to play with codes .. to the subject .. I have a script that its function is: when adding it to the graph it adds a fibonacci retracement but modified with risk reward .. I would like to know if you can make an EA that when taking an order this case "sell" add this fibonacci automatically I leave the code .. who can help me I appreciate it very much!