open = high , open = low , exploration afl

#1



PHP:
Buy =  TimeFrameGetPrice("L",inDaily,0)==TimeFrameGetPrice("O",inDaily,0) ;

Sell =  TimeFrameGetPrice("H",inDaily,0)==TimeFrameGetPrice("O",inDaily,0) ;


Filter=Buy OR Sell;

AddColumn(IIf(Buy,BuyPrice,Null)," open=low ", 6.2,1.2,colorGreen);
AddColumn(IIf(Sell,SellPrice,Null)," open= high ",6.2,1.2,colorOrange);
 

pankajpari

RSITradeMaster
#2
Hi, this is really a very good strategy and works very well.

Can someone help me create Buy Sell signals for the same. I tried the same as follows but I am not able to backtest the same correctly.

//---------------------------------------------------------------------------
// Buy & Sell Conditions
//---------------------------------------------------------------------------

Buy = TimeFrameGetPrice("O",inDaily,0) == TimeFrameGetPrice("L",inDaily,0);
Short = TimeFrameGetPrice("O",inDaily,0) == TimeFrameGetPrice("H",inDaily,0);

Sell = TimeNum() >= 152500;
Cover = TimeNum() >= 152500;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);

BuyPrice = ValueWhen(Buy,O);
ShortPrice = ValueWhen(Short,O);

Filter = Buy OR Sell OR Short OR Cover;


PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorDarkBlue, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorBlue, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);

PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-45);

PlotShapes(IIf(Short, shapeSquare, shapeNone),colorDarkRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-45);


//---------------------------------------------------------------------------
// End of AFL
//---------------------------------------------------------------------------


Wanted the following features to be added in the AFL [to trade Nifty 50 & Nifty MidCap 100 scrips; No. of Lots = 4 and / or Maximum Amount per trade = Rs. 2,00,000; Maximum Loss per Trade is 2% of Trading Capital and Maximum Loss per day is 6% of Trading Capital] :

1) Set Position size,
2) Enter the trade at Open + 1 minute,
3) Initial Stop Loss at Low (if Open = Low) and at High (if Open = High),
4) Trailing Stop Loss,
5) Booking 25% of the Position once the scrip has moved 0.3%,
6) Booking another 25% of the position once the scrip has moved 0.5%
5) Squaring off the balance position at 3:25 PM on the same day.

Also, while backtesting this strategy, what settings should be used in the "Trades" window....(i.e., what should be the Buy Price, Sell Price, Short Price & Cover Price.) Also, should one use the Buy Delay / Sell Delay options and if yes, what is its significance and how should it be used.

Thnx in advance.
 
#3
Wanted the following features to be added in the AFL [to trade Nifty 50 & Nifty MidCap 100 scrips; No. of Lots = 4 and / or Maximum Amount per trade = Rs. 2,00,000; Maximum Loss per Trade is 2% of Trading Capital and Maximum Loss per day is 6% of Trading Capital] :
will have to check how to code for portfolio level SL limits
but for all types of SL on trades use

ApplyStop( type, mode, amount, exitatstop, volatile = False, ReEntryDelay = 0 )

1) Set Position size,
SetPositionSize( size, method )
2) Enter the trade at Open + 1 minute,
Choose 1 mins TF to test/scan/trade and buy at close with delay as 0
3) Initial Stop Loss at Low (if Open = Low) and at High (if Open = High),
set this condition on sell / cover

4) Trailing Stop Loss,
Again use ApplyStop
5) Booking 25% of the Position once the scrip has moved 0.3%,
6) Booking another 25% of the position once the scrip has moved 0.5%
use sigScaleIn / sigScaleOut

can read about "Pyramiding (scaling in/out) and mutliple currencies in the portfolio backtester" in ami help

5) Squaring off the balance position at 3:25 PM on the same day.
add this condn to both sell & cover OR TimeNum() > 152500;

Also, while backtesting this strategy, what settings should be used in the "Trades" window....(i.e., what should be the Buy Price, Sell Price, Short Price & Cover Price.) Also, should one use the Buy Delay / Sell Delay options and if yes, what is its significance and how should it be used.
use 1 min TF, all prices = close with delay as 0

Cheers
:thumb:

EDIT: add all the tickers you want to trade into a watchlist / favorite and apply to only that
 
#7
I m trading this set up from last 1 year now; its called marubuzo candle trading. Works like a dream.
I trade in the direction of nifty trend on that day. Please send me the complete afl if u get it. wud love 2 automate this now.
[email protected]