BrainSystem: Trading System Development and Trades - page 15

 
jpsdyb:
I noticed 1 minute 0 seconds to bar end.

What are you using to show this information??

Thank you

nothing it is just an indicator which shows the remaind time to bar close.here is the indicatore you can use it.some of strategies like woodi's CCI use remaind time to bar close for opening an order.

ok?

Files:
 

Kamyar, thanks a million!!

also anyone know how to add enable alert to BrainTrendSig2? I tried to modify the script and metaeditor compile test 0 errors and 0 warnings. It still not working though, and i am confused as to why. I know to change enable alerts to 1, but it's the indicator itself as the problem. It does not load correctly.

Thanks

//+------------------------------------------------------------------+

//| BrainTrend2.mq4 |

//| www.forex-tsd.com |

//| Nick Bilak |

//+------------------------------------------------------------------+

#property copyright "BrainTrading Inc."

#property link "www.forex-tsd.com"

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_color2 Red

//---- input parameters

extern int NumBars=500;

extern int EnableAlerts=0;

extern int SignalID=0;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double spread;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_ARROW);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexArrow(0,233);

SetIndexStyle(1,DRAW_ARROW);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexArrow(1,234);

spread=MarketInfo(Symbol(),MODE_SPREAD)*Point;

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custor indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start() {

int counted_bars=IndicatorCounted();

//----

int artp=7;

double dartp=7.0;

double cecf=0.7;

int satb=0;

int Shift=0;

bool river=True;

double Emaxtra=0;

double widcha=0;

double TR=0;

double Values[100];

int glava=0;

double ATR=0;

int J=0;

double Weight=0;

double r=0;

double r1=0;

int p=0;

int Curr=0;

double Range1=0;

double s=2;

double f=10;

double val1=0;

double val2=0;

double h11=0;

double h12=0;

double h13=0;

double const=0;

double orig=0;

double st=0;

double h2=0;

double h1=0;

double h10=0;

double sxs=0;

double sms=0;

double temp=0;

double h5=0;

double r1s=0;

double r2s=0;

double r3s=0;

double r4s=0;

double pt=0;

double pts=0;

double r2=0;

double r3=0;

double r4=0;

double tt=0;

double tsig=0;

if( Bars < NumBars) satb = Bars; else satb = NumBars;

if( Close[satb - 2] > Close[satb - 1]) river = True; else river = False;

Emaxtra = Close[satb - 2];

Shift=satb-3;

while(Shift>=0) {

TR = spread+ High[Shift] - Low[Shift];

if( MathAbs(spread+ High[Shift] - Close[Shift + 1]) > TR ) TR = MathAbs(spread+ High[Shift] - Close[Shift + 1]);

if( MathAbs(Low[Shift] - Close[Shift + 1]) > TR) TR = MathAbs(Low[Shift] - Close[Shift + 1]);

if (Shift == satb - 3 ) {

for(J=0;Shift<=artp-1;J++) {

Values[J] = TR;

}

}

Values[glava] = TR;

ATR = 0;

Weight = artp;

Curr = glava;

for (J = 0;J<=artp - 1;J++) {

ATR += Values[Curr] * Weight;

Weight -= 1.0;

Curr--;

if (Curr == -1) Curr = artp - 1;

}

ATR = 2.0 * ATR / (dartp * (dartp + 1.0));

glava++;

if (glava == artp) glava = 0;

widcha = cecf * ATR;

if (river && Low[Shift] < Emaxtra - widcha) {

river = False;

Emaxtra = spread+ High[Shift];

}

if (!river && spread+ High[Shift] > Emaxtra + widcha) {

river = True;

Emaxtra = Low[Shift];

}

if (river && Low[Shift] > Emaxtra) {

Emaxtra = Low[Shift];

}

if (!river && spread+ High[Shift] < Emaxtra ) {

Emaxtra = spread+ High[Shift];

}

Range1 = iATR(NULL,0,10,Shift);

val1 = 0;

val2 = 0;

if (river) {

if (p != 1) r1 = Low[Shift] - Range1 * s / 3.0;

if (p == 1) r1 = -1.0;

if (r1 > 0) {

val1 = r1;

val2 = 0;

} else {

val1 = 0;

val2 = 0;

}

ExtMapBuffer1[Shift]=val1;

p = 1;

} else {

if (p != 2) r1 = spread+ High[Shift] + Range1 * s / 3.0;

if (p == 2) r1 = -1.0;

if (r1 > 0) {

val1 = 0;

val2 = r1;

} else {

val1 = 0;

val2 = 0;

}

ExtMapBuffer2[Shift]=val2;

p = 2;

Shift--;

}

}

if (EnableAlerts == 1)

{

if (val1 > 0 && tsig != 1)

{

tsig = 1;

// a1 = FileOpen("alert1" + SignalID,";");

Alert("BrainTrend2Sig", "Sell " ,Symbol() ," at ", Close[0] , " S/L " , val1 , " BT1 M" ,Period());

//a1=FileOpen("alert1"+ SignalID,FILE_CSV|FILE_WRITE,';');

// FileWrite(a1,"Sell " ,Symbol() ," at ", Close[0] , " S/L " , val1 , " BT1 M" ,Period());

// FileClose(a1);

}

if (val2 > 0 && tsig != 2)

{

tsig = 2;

Alert("BrainTrend2Sig", "Buy " , Symbol() , " at " ,Close[0] ," S/L " ,val2 ," BT1 M" , Period());

//a1 = FileOpen("alert1" + SignalID,";");

// a1=FileOpen("alert1"+ SignalID,FILE_CSV|FILE_WRITE,';');

// FileWrite(a1,"Buy " , Symbol() , " at " ,Close[0] ," S/L " ,val2 ," BT1 M" , Period());

//FileClose(a1);

}

}

//----

return(0);

}

//+------------------------------------------------------------------+
 

I am still having a hope that we will have EA for this system for alarm, confirmation and for everything (not for trading). In this case it will be very easy to trade using this system. I think we will have it soon.

But now I am thinking how to use this system without M15 confirmation and on timeframe less than H1.

Right now I am looking on the M30 charts and hope that it will work.

Anyway I will do forward test from tomorrow. But I feel that it will be necessary to change some rules for this trading strategy.

Files:
1_23.gif  30 kb
2_16.gif  31 kb
3_6.gif  32 kb
4_4.gif  30 kb
 

Please find the indicators and template which I want to evaluate.

I still hope to find some rules for this system trading on M15 or M30 timeframe.

Files:
indicators.zip  16 kb
bt7_m30.zip  4 kb
 

Well.

Just want to see how it works.

The rules #1.

Enter on BT1sig and BT2 sig. It should not be on the same bar especially. And it should be confirmed by SAR and I-XO indicator. We may wait one bar more after the signal for the confirmation from I-XO. BT1sig and BT2sig should be confirmed by SAR on the same bars with the signals. For example, if we have buy signal from BT1sig (for example) we are looking for SAR. If it is uptrend for SAR on the same bar with signal we are waiting for BT2sig (for example). The second signal should be confirmed by SAR as well. If everything is ok we are waiting for the confirmation by I-XO (no more than 1 bar after the last signal). It is most difficult case. Of course if we have everything (two signals and two confirmation on the same bar) it is perfect.

We are taking into account the full bars only.

Most difficult case I discribed already and you may see it from the image 1.

Exit is on SAR very simple (image 2).

It is very simple and flexible rules.

Why rules #1?

Because I am not sure that we will have this rules finally. Everybody may suggest an other rules, or I may change this one.

Files:
2_17.gif  28 kb
1_24.gif  28 kb
 

From Friday morning we should have the following:

EURUSD.

buy 1.2127 at 19:30 (20/01) and exit 1.2233 at 06:30 (23/01): +106 p.

buy 1.2259 at 10:30 (23/01) and exit 1.2285 (order may be still opened): +26 p.

USDCHF.

sell 1.2820 at 14:30 (20/01) and exit 1.2666 at 07:30 (23/01): +154 p.

sell 1.2628 at 10:30 (23/01) and exit 1.2233 (order may be still opened): +54 p.

GBPUSD.

buy 1.7583 at 10:30 (20/01) and exit 1.7794 at 05:00 (23/01): +214 p.

sell 1.7763 at 08:30 (23/01) and exit 1.7798 at 10:30 (23/01): -35 p.

buy 1.7798 at 10:30 (23/01) and exit 1.7866 (order may be still opened): +68 p.

USDJPY.

buy 155.32 at 16:30 (20/01) and exit 155.14 at 00:00 (23/01): -18 p.

sell 114.79 at 02:00 (23/01) and exit 114.78 at 10:00 (23/01): +1 p.

sell 114.30 at 10:30 (23/01) and exit 114.62 at 16:00 (23/01): -32 p.

538 p in total.

I think this rules #1 is too flexible.

May be.

 

I will be very good if somebody estimate an other rules (with other possible indicator if any). But I think the rules should be realistic ones. For example I counted the profit on historical data (that is not good of course because it should be forward testing) but I counted it as a robot (as an EA for example) fully following the rules. I used historical data just to be sure that it works.

 

hi newdigital

thanks for your effort.i have some questions

1.what is the stochastic indicator duty in your system?

2.we should get bt1signal first and the bt2signal then or it can be in any sort?

3.what is exactly the filled zones.i think you mean we should not trade in the zones.ok?

thanks

 

you mentioned that the bt signals should not be in the same bar.as far as i got it we should not trade in this case.would you described it.am i right?

 
newdigital:
I will be very good if somebody estimate an other rules (with other possible indicator if any). But I think the rules should be realistic ones. For example I counted the profit on historical data (that is not good of course because it should be forward testing) but I counted it as a robot (as an EA for example) fully following the rules. I used historical data just to be sure that it works.

I'm currently testing a new strategy On Eur/Usd 1HR using Braintrend2, Stochastics, and 2 LSMA-color indicators. So far going through the history charts, the results seem to be pretty worthwhile. Rules are pretty simple to use. If only had BraintrendSig2 with alerts, I could do more frequent testing. I will continue testing strategy and post results soon.

Reason: