Simple Coding Help - No Promise.

Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
Help needed in plotting buy sell arrows. Bias 24 Crossing 0 line.

Regards
Debashish

Replace the 4 lines

Code:
Buy  = Cross(b3, b4);
Sell = Cross(b4, b3) ;


PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen,0,b4,-20);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed,0,b4,-20);


Happy :)
 

Krushna

Active Member
Joined
Jan 11, 2015
Messages
258
Likes
155
Hi,
Can there be a sound alert/pop up after every thirty minutes while backtesting in Amibroker?
 
Joined
Aug 27, 2012
Messages
30
Likes
19
Hi

I have not gone through your code.

But seems the difference is due to
The close of candle on which your sell/cover signals are triggered is considered as the trade price.

If you want to use fixed points for profit and/or loss why not simply try using the builtin function.

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


No need to use a loop simply define your Buy/Sell/Short/Cover conditions and use stops
something like
Code:
Profit = 30;
Loss   = 10;
ApplyStop(stopTypeProfit, stopModePoint,Profit,ExitAtStop=1);
ApplyStop(stopTypeLoss, stopModePoint,Loss,ExitAtStop=1);

Happy :)
Thank you happy ji..I will try out as mentioned above :)
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
Thank you happy ji..I will try out as mentioned above :)
Try this

Code:
Buyc   = C > Ref(LSA, -P3) AND C > Ref( LSB, -P3) AND CL > BL;
Shortc = C < Ref(LSA, -P3) AND C < Ref( LSB, -P3) AND CL < BL;

Buy  = Cover = Ref(Buyc, -1) ==1; 
Sell = Short = Ref(Shortc,-1)==1;

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

Profit = 1.6;		Loss   = 0.5;
ApplyStop(stopTypeProfit, stopModePercent,Profit,ExitAtStop=1);
ApplyStop(stopTypeLoss, stopModePercent,Loss,ExitAtStop=1);

Happy :)
 

mastermind007

Well-Known Member
Joined
Dec 17, 2011
Messages
2,495
Likes
2,500
Hi,
Can there be a sound alert/pop up after every thirty minutes while backtesting in Amibroker?
Every 30 minutes?

How long does your back test take? Longest I have ever seen a backtest run is 80 seconds.
 

Krushna

Active Member
Joined
Jan 11, 2015
Messages
258
Likes
155
Every 30 minutes?

How long does your back test take? Longest I have ever seen a backtest run is 80 seconds.
Seems I didnt elaborate. I backtest manually, bar by bar, with some Price Action strategy. And after every 30 minutes of the market, I also need to check what the 30 min bar is saying. So instead of keeping a check of how far I have advanced in the market timing, if there is some way that alerts me at 9.30, 10.00 and so on according to the bar in Amibroker timing, I would focus more on analysing.

Regards
Krushna.
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
Seems I didnt elaborate. I backtest manually, bar by bar, with some Price Action strategy. And after every 30 minutes of the market, I also need to check what the 30 min bar is saying. So instead of keeping a check of how far I have advanced in the market timing, if there is some way that alerts me at 9.30, 10.00 and so on according to the bar in Amibroker timing, I would focus more on analysing.

Regards
Krushna.
Code:
AlertIf(GetSecondNum() % (30*60) <= 10, "SOUND C:\\MyAlertMusic.wav", "Audio Alert", 2 );

Use a sound file in wav format, rename it as MyAlertMusic.wav put it on root of C drive.

The sound file will play every 30 minutes, when amibroker is open


Have not tested it for back testing, may not work with bar by bar replay mode




Happy :)
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
Seems I didnt elaborate. I backtest manually, bar by bar, with some Price Action strategy. And after every 30 minutes of the market, I also need to check what the 30 min bar is saying. So instead of keeping a check of how far I have advanced in the market timing, if there is some way that alerts me at 9.30, 10.00 and so on according to the bar in Amibroker timing, I would focus more on analysing.

Regards
Krushna.
instead of sound alert you can also try inserting this code in your lower time frame chart

Code:
PlotShapes((floor(((TimeNum()%10000)/100)-0.01)==29)*7,colorWhite,0,L);
Happy :)
 

mastermind007

Well-Known Member
Joined
Dec 17, 2011
Messages
2,495
Likes
2,500
Krushna said:
Seems I didnt elaborate. I backtest manually, bar by bar, with some Price Action strategy. And after every 30 minutes of the market, I also need to check what the 30 min bar is saying. So instead of keeping a check of how far I have advanced in the market timing, if there is some way that alerts me at 9.30, 10.00 and so on according to the bar in Amibroker timing, I would focus more on analysing.
instead of sound alert you can also try inserting this code in your lower time frame chart

Code:
PlotShapes((floor(((TimeNum()%10000)/100)-0.01)==29)*7,colorWhite,0,L);
Happy :)
Hmmmm.... Source of Confusion is your inappropriate usage of term back-testing.

Anyways, there is a tool called "Cycle Lines" in Amibroker which can do what you want. Its bitmap image has three parallel vertical lines with one dashed horizontal line cutting it. You can use this tool to place repeating vertical lines on screen at preset intervals.

Drag and drop the tool and then double-click it to manually do the settings.

Some tips on doing the manual settings: Keep value of Start Y and End Y same. Manually enter start time as 9:30 AM and end time as 10:00 AM.

Extra tip: Keep color extremely faint
 

Similar threads

Broker Special Offers