Limiting BIN files to a maxsize of lines per file

仕事が完了した

実行時間1 日
開発者からのフィードバック
Friendly customer
依頼者からのフィードバック
Good job, straight to the point and honest.

指定

Hi all, the simple script im currently using has the below functions Ontick:

- Takes the Bid or Ask price of the current chart pair.
- Opens/Creates a new bin file.
- Stores that Bid or Ask price at the BOTTOM of the bin file
- Reopens the bin file to read it
- Stores it into an array in order to be manipulated

I would like to be able to limit this file, because obviously right now the file just keeps getting bigger, to a certain number of lines (circular buffer?)
So that at the current tick, and lets say maxsize = 5, the file looks like this:
-E, D, C, B, A (A being the oldest bid/ask price stored at the end of the line)

on next tick
-F, E, D, C, B  (A deleted and F inserted as the most recent tick price)

The code is the below:

void OnTick()



  {

   double PriceDiff = MarketInfo("AUDCAD",(MODE_ASK));

        

   int fileHandle2 = FileOpen("Myfile.bin",FILE_BIN|FILE_READ | FILE_WRITE);

       

   FileSeek(fileHandle2, 0, SEEK_END); // Write at the end of the file.

   double data2 = PriceDiff;

   FileWriteDouble(fileHandle2,data2);

   FileClose(fileHandle2);    

   double arr[];

   string path= "";

   ResetLastError();

   int file_handle=FileOpen("Myfile.bin",FILE_READ|FILE_BIN);

   if(file_handle!=INVALID_HANDLE)

     {

      FileReadArray(file_handle,arr);

      //--- receive the array size

      int size=ArraySize(arr);

      //--- print data from the array

      for(int i=0;i<size;i++);

      Comment("Total data = ",size);

      //--- close the file

      FileClose(file_handle);


I hope the explanation is clear enough, if not we can discuss further. 

Thanks in advance
Chris

応答済み

1
開発者 1
評価
(5)
プロジェクト
7
29%
仲裁
1
0% / 100%
期限切れ
0
2
開発者 2
評価
(4)
プロジェクト
4
0%
仲裁
1
0% / 100%
期限切れ
1
25%
3
開発者 3
評価
(6)
プロジェクト
7
0%
仲裁
0
期限切れ
5
71%
4
開発者 4
評価
(1)
プロジェクト
2
0%
仲裁
0
期限切れ
1
50%
5
開発者 5
評価
(82)
プロジェクト
86
57%
仲裁
25
0% / 84%
期限切れ
19
22%
6
開発者 6
評価
(62)
プロジェクト
140
46%
仲裁
19
42% / 16%
期限切れ
32
23%
7
開発者 7
評価
(7)
プロジェクト
13
0%
仲裁
5
20% / 60%
期限切れ
0
類似した注文
Hello, I would Like to convert MQL4 to ctrader, if this is what you can do successfully, Kindly let me know. The MQL4 fill is attached. Thanks and Looking forward to work with you
Project Details Seeking an experienced developer to build a custom plugin for Metatrader 5. The plugin should allow us to view manager and account summaries based on important data including trade size, profit and loss, symbols, and customizable percentage calculations. Key Features: - Filtering accounts by profitability, risk, and performance - Displaying the summary details in a table format Threshold Competencies
can you help me with a creation of an MT4 track record of this last year, send me your tracking record and i promise to send you $30 for free
I would like to create a news filter in Fxdreema what include in the news filter ? 1. Scalping news from the internet 2. Stop passing before the news has announced 3. After the news X mins allow to pass 4. Can filter importance level
I have an EA that generates 3 Alerts per 1 min candle. I'd like to capture the Alert data and place it straight into an open real time Excel sheet. Each alert has a target cell within a column, and when a candle closes I want the new 3 x Alert data generated captured, and placed into the same rows but in an appended column. I would also like a copy of the code in order to help me improve my MT4 knowledge
I need someone to create a automatic trading bot for metatrader 4 with specific settings. The bot needs to use a neo cloud indicator on trading view with my personalized settings to go long and short with a particular amount of lot size and it repeats itself when the conditions are met
I want to do an indicators that print on chart the cycle. My budget for it is $20, Can you do it for $20? Kindly read very well. I need 7 people how can do this, Thanks
I'm a new trader learning to trade. I ordered 6 EAs from Parabolic Trading Group to trade on my various prom firm accounts but now we in USA can't use Metatrader 4 or Metatrader5 to trade prom firm accounts. Can you help me to convert these EAs to Dxtrade. These EAs are for Metatrader4, the company didn't give me a copy for Metatrader5. I have VPS already installed with all the EAs on Metatrader4. Thank you
I want to convert my ninjatrader 7 code to ninjatrader 8. Is this what you can get done for me, check the attached file and Let me know if this is what you can do
Hello, How are you doing? i am looking for a tradingview developer to execute my project. Kindly bid if this is your area of specialization Note: project description will be discuss via inbox Thanks

プロジェクト情報

予算
30 - 50 USD
VAT(付加価値税) (18%): 5.4 - 9 USD
合計: 35.4 - 59 USD
開発者用
27 - 45 USD
締め切り
最低 1 最高 10 日