Need help to show this in ForexTester

How to create strategies and indicators
Message
Author
harold.md
Posts: 1
Joined: Mon Feb 06, 2012 10:59 am

Need help to show this in ForexTester

#1 Postby harold.md » Sat Feb 11, 2012 10:15 pm

Hello, I don't now how to program, I battled a lot to complete what is shown in the picture attached.

I tried to do it for ForexTester, but it's so difficult to me. I will appreciate if some programmer could do me the favor of coding this, it's not too much:

Thank you.

====================

//+------------------------------------------------------------------+
//| Position Size Calculator.mq4 |
//| Harold |
//| |
//+------------------------------------------------------------------+
#property copyright "Harold"
#property link ""

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int digitos;
int multiplo_spread;

int init()
{
if (Symbol()=="GBPJPY" || Symbol()=="EURJPY" || Symbol()=="USDJPY")
digitos = 3;
else digitos = 5;

if (Symbol()=="GBPJPY" || Symbol()=="EURJPY" || Symbol()=="USDJPY")
multiplo_spread = 100;
else multiplo_spread = 10000;

return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//int counted_bars=IndicatorCounted();


double sl = 0;
double balCuenta = AccountBalance();
int porcRiesgo = 5;
double dHigh = iHigh(NULL,PERIOD_D1,1);
double dLow = iLow(NULL,PERIOD_D1,1);

double balRiesgo = (balCuenta * porcRiesgo)/100;
double spread = MarketInfo(Symbol(), MODE_SPREAD)/10;
int pipsMargen = 10;

double buyPos = dHigh + (pipsMargen + spread)/multiplo_spread;
double buySL = dLow + (pipsMargen + spread)/multiplo_spread;
double buyPipsDif = (buyPos - buySL) * multiplo_spread;
double buyLots = (balRiesgo/buyPipsDif)/10;

double sellPos = dLow + (pipsMargen + spread)/multiplo_spread;
double sellSL = dHigh + (pipsMargen + spread)/multiplo_spread;
double sellPipsDif = (sellSL - sellPos) * multiplo_spread;
double sellLots = (balRiesgo/sellPipsDif)/10;

string texto = "";

texto = "\n" +
"• BALANCE: " + DoubleToStr(balCuenta,2) +
" • RIESGO 5%: " + DoubleToStr(balRiesgo,2) +
" • SPREAD: " + DoubleToStr(spread,1) + "\n" + "\n" +

" PREVIOUS DAY HIGH & LOW BUY • SELL" + "\n" +
"===================== ================" + "\n" +
"• HIGH: " + DoubleToStr(dHigh, digitos) +
" • LOW: " + DoubleToStr(dLow, digitos) + " LOTS: " + DoubleToStr(buyLots, 3) +
" " + DoubleToStr(sellLots, 3) + "\n" +

" OPEN: " + DoubleToStr(buyPos, digitos) + " " +
DoubleToStr(sellPos, digitos) + "\n" +

" SL: " + DoubleToStr(buySL, digitos) + " " +
DoubleToStr(sellSL, digitos) + "\n" +

" DIF. PIPS: " + DoubleToStr(buyPipsDif, 0) + " " +
DoubleToStr(sellPipsDif, 0);
Comment(texto);

return(0);
}
//+------------------------------------------------------------------+


====================
Attachments
pic1.gif
pic1.gif (29.07 KiB) Viewed 14106 times

Stonev
Posts: 204
Joined: Thu Jan 28, 2010 2:20 pm

#2 Postby Stonev » Mon Feb 13, 2012 4:08 am

Hello,
I can help you,
see PM

runsi
Posts: 4
Joined: Sun Jun 28, 2015 3:48 am

Re: Need help to show this in ForexTester

#3 Postby runsi » Sun Jun 28, 2015 3:54 am

Hello Stonev, any chance you could send this to me as well?


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 20 guests