Simple Coding Help - No Promise.

can anybody teach me how can i put buy on next bar only if it crosses High if this bar...?

Let me try to put it in better words ,..
First i setup buying conditions call it conditionBuy ..
when conditionBuy is True, All i want is Ami to put a Stop Limit buy order above current BAR high.

If stock fails to cross HIGH in next bar, it should set conditionBuy to FALSE again.

It can be done easily in EasyLanguage but dont know how to get it done in Amibroker (i have a very little experience with amibroker , i m learning it)

Thanks and Regards
 
Gentlemen,
Need some assistance to configure Amibroker to export real time data into excel.
As most of you might be aware Amibroker 6.2 and above, can export real time data, with the time frame of your choice into nice .csv or text file, which can later be used in whichever way you want. And this is done with the use of batch file. However by default we only have 1 hour and Daily. Can some expert try to configure this so that we can export all time frame data to .csv or .txt files.

Here is the link on the procedure : https://www.amibroker.com/guide/h_batch.html

1573662513845.png



Would really appreciate your kind assistance.

Warm Regards
GK
 
Hi guys

What is wrong in the below statement? Why sys is saying that I cannot use array here (error 6)? I have gone through the Help document and believe it conforms to the rules unless iam missing something here.
Code:
for( i = 1; i < BarCount; i++ )
{
   if (Open[i] < Close[i])
   {
      if (Ref(High[i],1) > High[i])
    {
 
Hi guys

What is wrong in the below statement? Why sys is saying that I cannot use array here (error 6)? I have gone through the Help document and believe it conforms to the rules unless iam missing something here.
Code:
for( i = 1; i < BarCount; i++ )
{
   if (Open[i] < Close[i])
   {
      if (Ref(High[i],1) > High[i])
    {
Ref() is an array function, use [i-1]
 
Thanks for all your help. Could get to write a piece of code without any errors !

When I was using Scan from Auto Analysis for that piece of code, Iam not getting proper results. The Buy and Sell signals are placed in all the days including the days for which there is no legal trade initiated.

Pls check and help me to figure out the mistake in this. Exrem does not help me here. Iam trying to figure out where to keep the Buy and Sell keywords either within the loop, if so at what level or outside the loop.

Code:
Entrytrigger = 0;

for( i = 1; i < (BarCount-1); i++ )
{
   if (Open[i] < Close[i] AND High[i+1] > High[i] AND (Entrytrigger == 0 OR Entrytrigger == 3))
   {
        SLLong = Low[i];
        PRLong = High[i]+((High[i]-Low[i])*2);
        Entrytrigger = 2;
        Buy = Entrytrigger == 2;
    }  
    if (Entrytrigger == 2)
    {
        if (High[i] > PRLong)
        {
        Entrytrigger = 3;
        Sell = Entrytrigger == 3;
        }
    }
    if (Entrytrigger == 2)
    {  
        if (Low[i] < SLLong)
        {
        Entrytrigger = 3;
        Sell = Entrytrigger == 3;
        }
    }
}
BK1.png
 
Last edited:

Similar threads