[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Can somehelp help with a LOOP here ?



PureBytes Links

Trading Reference Links

Folks:
 
Say I have AFL to write orders to csv file.  Now I would include to a LOOP to write TEN orders in increment of 10 pips.
so that orders are generated as follows 1.4610, 1.4620,1.4630 and so on upto 1.4710
 
 
Buystop_Startvalue=1.4610
Ten_pips=0.0010;
 
I need a loop that would increment Strategy4_BuyStopEntry by 10 pips and execute the below code so that I have 10 sequential orders.
 
 
Below is the code to write orders to a csv file:

if( LastValue(NewBar_Started) AND LastValue(Ref(Strategy4_4Hour_Buy,-1))  )
{
mvOrderOIF =
"\n"+
 Broker_Symbol+
","+ "BUYSTOPLIMIT" +
","+ (Strategy4_BuyStopEntry) + 
"\n"; 
 
 filepath="C:\\Program Files\\Amibroker\\AFL\\PADHU\\AT\\MIG_0011_ORDERS.txt";
  filehandle=fopen(filepath, "a");
  fputs(mvOrderOIF, filehandle);
  fclose(filehandle);
 
  filepath="C:\\Program Files\\Amibroker\\AFL\\PADHU\\AT\\MIG_0011_ORDERS_LOG.txt";
  filehandle=fopen(filepath, "a");
  fputs(mvOrderOIFLog, filehandle);
  fclose(filehandle);
 
  fileischanged=1;
 
};
 
so that the resulting file looks like
EURUSD,BUYSTOPLIMIT,1.4610
EURUSD,BUYSTOPLIMIT,1.4620
EURUSD,BUYSTOPLIMIT,1.4630
 
....
 
....
EURUSD,BUYSTOPLIMIT,1.4710
 
Thanks,Padhu
 
 
 
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___