Trabajo finalizado
Tarea técnica
Hi,
I need someone to add code from an indicator and place it inside my EA.
The indicator code contains draw & delete trend line functions and secondary filter functions to produce buy and sell signals.
The freelancer will need to adjust the EA in the same format, due to my understanding of coding.
Basically take this code format from the indicator:
int counted_bars=IndicatorCounted(); int limit=Bars-counted_bars; if(bars<Bars) { DeleteLines(); for(int i=1; i<MaxBars-1; i++) { double Sar=iSAR(NULL,0,0.02,0.2,i); double SarBack=iSAR(NULL,0,0.02,0.2,i+1); //--- double Price=(High[i]+Low[i])/2; double PriceBack=(High[i+1]+Low[i+1])/2; bool flag=true; //---Paramters for drawing green buy down line if(High[i+1]>High[i]) if(SarBack<PriceBack && Sar>Price) { line_name_green[line_green]="Line_"+(string)i; flag=DrawLine("Line_"+(string)i,Time[i+1],High[i+1],Time[i],High[i],clrGreen); line_green++; } } for(int u=1; u<line_green; u++) { double line_price; for(int i=1; i<MaxBars-1; i++) //---Parameters for buy signal { line_price=ObjectGetValueByShift(line_name_green[u],i); double PriceMedian=(High[i]+Low[i])/2; double PriceMedianBack=(High[i+1]+Low[i+1])/2; double Ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,i); double Ema10=iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i); //--- if(Ema5>Ema10) if(PriceMedianBack<line_price && PriceMedian>line_price) UpArrow[i]=Open[i]; } } //Loops for green lines and UpArrow end here. //--- Down Arrow for(int i=1; i<MaxBars-1; i++) { bool flag=true; double Sar=iSAR(NULL,0,0.02,0.2,i); double SarBack=iSAR(NULL,0,0.02,0.2,i+1); //--- double Price=(High[i]+Low[i])/2; double PriceBack=(High[i+1]+Low[i+1])/2; //---Paramters for drawing red up line if(Low[i+1]<Low[i]) if(SarBack>PriceBack && Sar<Price) //--- { line_name_red[line_red]="Line_"+(string)i; //Save name of red line flag=DrawLine("Line_"+(string)i,Time[i+1],Low[i+1],Time[i],Low[i],clrRed); line_red++; //Icrement number of red lines } } //----- for(int n=1; n<line_red; n++) { double line_priceA; for(int i=1; i<MaxBars-1; i++) //---Parameters for buy signal { line_priceA=ObjectGetValueByShift(line_name_red[n],i); //--- double PriceMedian=(High[i]+Low[i])/2; double PriceMedianBack=(High[i+1]+Low[i+1])/2; double Ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,i); double Ema10=iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i); //--- if(Ema5<Ema10) if(PriceMedianBack>line_priceA && PriceMedian<line_priceA) //--- DownArrow[i]=Open[i]; } } } bars=Bars;
and place it in this section of the EA:
//+------------------------------------------------------------------+ //| TRIGGER FUNCTION | //+------------------------------------------------------------------+ void CheckForSignal() { static datetime candletime=0; if(candletime!=Time[0]) { //---Insert Trendline V1 buy code here double Ema200=iMA(NULL,0,200,0,MODE_SMMA,PRICE_MEDIAN,1); double Price=(High[1]+Low[1])/2; //Did it make an up arrow on candle 1? if(Price>Ema200) { if(CloseOnOppositeSignal) exitsells(); if(TotalOpenOrders()<MaxAmountOfTrades) if((HedgingAllowed) || (!HedgingAllowed && OpenOrders(OP_SELL)==0)) EnterTrade(OP_BUY); else Print("Hedging did not allow this trade."); } //---Insert Trendline V1 sell code here //Did it make a down arrow on candle 1? if(Price<Ema200) { if(CloseOnOppositeSignal) exitbuys(); if(TotalOpenOrders()<MaxAmountOfTrades) if((HedgingAllowed) || (!HedgingAllowed && OpenOrders(OP_BUY)==0)) EnterTrade(OP_SELL); else Print("Hedging did not allow this trade."); } candletime=Time[0]; } }
I will be happy to pass the EA and indicator on confirmed work agreement. Also it would be great if we could talk the job through on skype as I am learning to improve my coding.
I of course will only sign the job off on my testing the functionality on both tester and live trades. I have said 2 days to do the job but it may take another day for me to test fully.
Regards Mike