Forex Trading Software





 
Methods of technical analysis

Custom Search



























code for out indicator

Below is the code for out indicator which will plot 8 different system simulations for the delay input in the system. Note that we provide user selectable inputs for the starting value of the delay period as well as an incremental factor (Delay_Inc) for the input, in much the same fashion that is used when one does an optimization.

Note that the code below calls our parallel function for each of the 8 simulations of the system, providing an input for the delay factor which starts with the beginning value (Delay_Start) and increments each

Input: Delay_Start(30),Delay_Inc(5),Tgt(5),Stp(4);

Vars:   Pts(0), TTlPts(0);

Arrays:   BSys[8](0), BSysT[8](0);

BSys[1] = OMW_BO(Delay_Start + (Delay_Inc*0),Tgt,Stp);

BSys[2] = OMW_BO(Delay_Start + (Delay_Inc*1),Tgt,Stp);

BSys[3] = OMW_BO(Delay_Start + (Delay_Inc*2),Tgt,Stp);

BSys[4] = OMW_BO(Delay_Start + (Delay_Inc*3),Tgt,Stp);

BSys[5] = OMW_BO(Delay_Start + (Delay_Inc*4),Tgt,Stp);

BSys[6] = OMW_BO(Delay_Start + (Delay_Inc*5),Tgt,Stp);

BSys[7] = OMW_BO(Delay_Start + (Delay_Inc*6),Tgt,Stp);

BSys[8] = OMW_BO(Delay_Start + (Delay_Inc*7),Tgt,Stp);

    If BSys[1] <> Bsys[1][1] then BSysT[1] = BSysT[1] + BSys[1];

    If BSys[2] <> Bsys[2][1] then BSysT[2] = BSysT[2] + BSys[2];

    If BSys[3] <> Bsys[3][1] then BSysT[3] = BSysT[3] + BSys[3];

  If BSys[4] <> Bsys[4][1] then BSysT[4] = BSysT[4] + BSys[4];

    If BSys[5] <> Bsys[5][1] then BSysT[5] = BSysT[5] + BSys[5];

    If BSys[6] <> Bsys[6][1] then BSysT[6] = BSysT[6] + BSys[6];

    If BSys[7] <> Bsys[7][1] then BSysT[7] = BSysT[7] + BSys[7];

    If BSys[8] <> Bsys[8][1] then BSysT[8] = BSysT[8] + BSys[8];

    Plot1(BSysT[1],"Delay1");

    Plot3(BSysT[3],"Delay2");

    Plot2(BSysT[2],"Delay3");      

    Plot4(BSysT[4],"Delay4");

    Plot1(BSysT[5],"Delay5");

    Plot2(BSysT[6],"Delay6");

    Plot3(BSysT[7],"Delay7");

  Plot4(BSysT[8],"Delay8");

The indicator on the above chart depicts graphically the results of 8 simulations of our system as plotted by the parallel function. The tracings depict the results of the system over 8 different breakout times as entered into the indicator by the function calls. The initial input of a 30 minute delay is incremented by the input factor of 5 for each successive simulated plot. Thus, plot Delay1 reflects the system with a breakout time 30 minutes after the open. Delay2 plots the system with a 35 minute delay, Delay3 equals a 40 minute delay, etc. Again, note the variations evident between the different system simulations.

Although the purple tracing, representing a system simulation with a breakout of the range established 55 minutes after the open, is the superior setting at this particular time, examination of the remainder of the chart will demonstrate that other settings are superior at other times. Note how several of the simulations continually compete with each other for the best performance. By plotting several indicators on chart, each representing simulations of several settings of different system parameters, the system developer or trader can get a graphic representation of the behavior of the system under constantly changing market conditions.

    The data window at right depicts the results of all 8 systems simulated in the chart above. Being aware of the settings in the indicator inputs, we know that Delay 1 represents a breakout of a range established 30 minutes after the market open. Each successive simulation represents a breakout range set up 5 minutes later than the preceding graphic. All other system parameters, the target and stop, remain static so the system can be measured accurately with the breakout range time being the only variable which is responsible for the changes in the system reports in the window at right.

The numbers reported in the data window are the actual dollar amounts which would have been generated by the system under each progressively incremented breakout time setting.

The indicator code below is identical to the previous program with the only exception being that the stop parameter of the system is being increased incrementally for each system simulation. The stop settings begin at 4 points, as determined by the input, and are increased by the Stop_Inc amount for each successive function call.

 

Input: Delay(45),Tgt(5),Stp_Start(4), Stop_Inc(1);

Vars:   Pts(0), TTlPts(0);

Arrays:   BSys[8](0), BSysT[8](0);

BSys[1] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*0));

BSys[2] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*1));

BSys[3] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*2));

BSys[4] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*3));

BSys[5] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*4));

BSys[6] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*5));

BSys[7] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*6));

BSys[8] = OMW_BO(Delay,Tgt,Stp_Start + (Stop_Inc*7));

If BSys[1] <> Bsys[1][1] then BSysT[1] = BSyst[1] + BSys[1];

If BSys[2] <> Bsys[2][1] then BSysT[2] = BSyst[2] + BSys[2];

If BSys[3] <> Bsys[3][1] then BSysT[3] = BSyst[3] + BSys[3];

If BSys[4] <> Bsys[4][1] then BSysT[4] = BSyst[4] + BSys[4];

If BSys[5] <> Bsys[5][1] then BSysT[5] = BSyst[5] + BSys[5];

If BSys[6] <> Bsys[6][1] then BSysT[6] = BSyst[6] + BSys[6];

If BSys[7] <> Bsys[7][1] then BSysT[7] = BSyst[7] + BSys[7];

If BSys[8] <> Bsys[8][1] then BSysT[8] = BSyst[8] + BSys[8];

Plot1(BSysT[1]*250,"Stop1");

Plot2(BSysT[2]*250,"Stop2");

Plot3(BSysT[3]*250,"Stop3");

Plot4(BSysT[4]*250,"Stop4");

The indicator on chart above represents the results of the system using 8 progressively incremented settings for the stop input. As before, the inputs for the other two parameters are held static so the graphs are representative of the system changes as effected only by the changing stop input.

As with the delay input indicator, the data window on the right reports the system results under 8 different settings for the stop parameter of our system.

At this point on the chart the stop setting with the highest value, or 11 points, is giving the best system results with the delay input frozen at 45 minutes after the open and the target for the system set at 5 points.



Category: Methods of technical analysis




Copyright © 2007 fxtrading-software.com