Simple Coding Help - No Promise.

I found this strategy in a forex forum and sounds intersting.

Hi there,

I have been trading this simple strategy which I find very effective.
I trade it mainly on 1 hour charts. Its effective on higher time frames but of course the risk increases as you go higher. May do some higher time frame examples here.

SCALPING GRAB & GO RISK:REWARD for the 1 hour is 2:1 OR 1:1 OR 1:1.5.

SHORT when there are TWO CONSECUTIVE BEARISH BARS and the SECOND closes WITH a LOWER CLOSE PRICE
LONG when there are TWO CONSECUTIVE BULLISH BARS and the SECOND closes WITH a HIGHER CLOSE PRICE

The WIN PROBABILITY is HIGHER when the CLOSE PRICES are NOT FAR APART.

Notes:

It is best to wait for a little pullback if close prices are not very close.
Try to enter as close as possible to the close price of the first bar.
If holding for more than 5 pips, this is best done when H4 or daily show SAME DIRECTION OR if the setup is the first following a REVERSAL.

Please also read THE FOLLOWING POST​

TYPICAL CALCULATION OF RISK:REWARD
Stop = Hard stop determined by trader OR 5 pips from the high or low of the first bar.
Reward = Fixed take profit determined by trader OR (for short) -> 2 X Distance between first bar's close and high, (for long) 2 X Distance between first bar's close and low.

please make it possible in Amibroker. Thanks in advance for the help.
 
Hi co-traders,

I'm trying to code for the following situation:
- After entry a minimum target is set (say buyprice + 1).
- Stoploss is set (say buyprice - 1).
- When Price reaches minimum target, stoploss is reset to 'Stopwin' (say buyprice + 0.5). Now the trade will never turn against you and further targets can be set.

This should not be too hard, but somehow it doesn't workout the way I want to.

Could someone have a look at this?
 
Hi co-traders,

I'm trying to code for the following situation:
- After entry a minimum target is set (say buyprice + 1).
- Stoploss is set (say buyprice - 1).
- When Price reaches minimum target, stoploss is reset to 'Stopwin' (say buyprice + 0.5). Now the trade will never turn against you and further targets can be set.

This should not be too hard, but somehow it doesn't workout the way I want to.

Could someone have a look at this?
TTR Bro,
been trying smthng similar, and found out (thru Explore ) that the HIDDEN Excess Buy/Short Signals in between the visible Buy/Short & Sell/Cover Signals r causing the Distortion -- Pls hve a look at post#3382.
Thnk U n Rgrds
--ShiraJ--
P.S.--> ur PM is not enabled, could u pls provide an id to communicate ---> SHIRAJANDROID at GMAIL dot COM
 
TTR Bro,
been trying smthng similar, and found out (thru Explore ) that the HIDDEN Excess Buy/Short Signals in between the visible Buy/Short & Sell/Cover Signals r causing the Distortion -- Pls hve a look at post#3382.
Thnk U n Rgrds
--ShiraJ--
P.S.--> ur PM is not enabled, could u pls provide an id to communicate ---> SHIRAJANDROID at GMAIL dot COM
Hi shirajoz,

Already found out about those excess buy/short signals which are not displayed because of the exrem statement.

About the PM..I thought it was activated by default. I just checked and it should be working. Or am I wrong?

Rgrds, TTR
 
Hi shirajoz,

Already found out about those excess buy/short signals which are not displayed because of the exrem statement.

About the PM..I thought it was activated by default. I just checked and it should be working. Or am I wrong?

Rgrds, TTR
Thnk U TTR bro,
Sent u a TEST msg PM just NOW and it went thru (it didn't 3 weeks ago !!!)
will PM in detail soon.

Rgrds
--ShiraJ--
 

trash

Well-Known Member
Hi co-traders,

I'm trying to code for the following situation:
- After entry a minimum target is set (say buyprice + 1).
- Stoploss is set (say buyprice - 1).
- When Price reaches minimum target, stoploss is reset to 'Stopwin' (say buyprice + 0.5). Now the trade will never turn against you and further targets can be set.

This should not be too hard, but somehow it doesn't workout the way I want to.

Could someone have a look at this?
You need loop, loop, loop, ....

#3382 is wrong.

sample
 
You need loop, loop, loop, ....

#3382 is wrong.

sample
Thanks again for your help trash, also @shirajroz! I really appreciate this.

Your chart shows exactly what I mean..again ;-). Respect for your coding skills.
To be honest, I was on a completely different path and I'm not sure how I have to make those loops work out the way you do.

But I'll try to figure out of course.
 
Rtd needed

Dear all,

i found joshi 1 RTD for ambibroker but does anyone have a RTD software for nest which feeds ninja trader here or where i can find a free utility

thanks in advance

regards,

vipul
 
http://www.traderji.com/amibroker/90153-afl-pivot-point-static.html#post874487

PHP:
_SECTION_BEGIN ("Chart Setup");
SetChartBkColor(ParamColor("Outer panel",colorSkyblue));
SetChartBkGradientFill(
ParamColor("Upper Inner panel",colorLightBlue),
ParamColor("Lower Inner panel",colorLightYellow)); 

SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);

//basic price plotting
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END ();

_SECTION_BEGIN ("Pivot Levels");

//--- Created by : KelvinHand -------
T_F =ParamList("TF Multiplier","Hour|Min|Day|Week|Month");
iInterval = Param("Interval", 1, 1);

Note1=ParamStr("-- Colors --", "PP, S1..S3, R1..R3");
PP_Color=ParamColor("PP Color",colorViolet);
Rn_Color=ParamColor("Rn Color",colorDarkRed);
Sn_Color=ParamColor("Sn Color",colorDarkGreen);
 
Note1=ParamStr("-- Styles --", "PP, R1S1, R2S2, R3S3");
PP_Style=ParamStyle("PP", styleDots|styleThick, maskAll);
R1S1_Style=ParamStyle("R1S1 Style", styleThick, maskAll);
R2S2_Style=ParamStyle("R2S2 Style", styleLine,  maskAll);
R3S3_Style=ParamStyle("R3S3 Style", styleDashed,maskAll);



_SECTION_END ();


shift=-1;

switch (T_F)
{
    case "Day":     iPeriod  = inDaily;        break;
    case "Hour":    iPeriod  = inHourly;    break;
    case "Min":        iPeriod  = in1Minute;    break;
}
     
  
     xTF = iInterval*iPeriod;
        H1 = TimeFrameGetPrice( "H", xTF, shift );
        L1 = TimeFrameGetPrice( "L", xTF, shift );
        C1 = TimeFrameGetPrice( "C", xTF, shift );

// To calculate the Pivot Levels 
  PP = (H1 + L1 + C1) / 3;
    R1 = (2 * PP) - L1 ;
    S1 = (2 * PP) - H1 ;
    R2 = PP - s1 + r1;
    S2 = PP - (r1 - s1) ;
    R3 = 2 * (PP - L1) + H1 ;
    S3 = L1 - (2 * (H1 - PP));


//    Plot Pivot Levels in the charts

Plot (PP,"",PP_Color,PP_Style);

Plot (R1,"",Rn_Color,R1S1_Style);
Plot (S1,"",Sn_Color,R1S1_Style);

Plot (R2,"",Rn_Color,R2S2_Style);
Plot (S2,"",Sn_Color,R2S2_Style);

Plot (R3,"",Rn_Color,R3S3_Style);
Plot (S3,"",Sn_Color,R3S3_Style);

//    Add Pivot levels on charts as text
Title = Title + EncodeColor(colorDarkTeal)+
"\nPivot T_F = "+NumToStr(iInterval,1.0)+" "+T_F + "\n" +
EncodeColor(Rn_Color)+"R3 = "+ r3 +"\n"+
EncodeColor(Rn_Color)+"R2 = "+ r2 + "\n"+
EncodeColor(Rn_Color)+"R1 = "+ r1 + "\n"+ "\n"+
EncodeColor(PP_Color)+"PP = "+ PP + "\n"+ "\n" +
EncodeColor(Sn_Color)+"S1 = "+ s1 + "\n"+
EncodeColor(Sn_Color)+"S2 = "+ s2 + "\n"+
EncodeColor(Sn_Color)+"S3 = "+ s3 + "\n";

_SECTION_END ();
taken from the thread above .

i want to apply both 1 hour , and 4 hour pivot at same time , i tried applying afl twice on same chart but it didnt work .

2ndly , the chart gets skewed when this afl is applied , kindly correct the afl for both issues :)

thanks a lot
 

Similar threads