Limiting BIN files to a maxsize of lines per file

MQL4 Experten Skripte

Auftrag beendet

Ausführungszeit 1 Tag
Bewertung des Entwicklers
Friendly customer
Bewertung des Kunden
Good job, straight to the point and honest.

Spezifikation

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

Bewerbungen

1
Entwickler 1
Bewertung
(5)
Projekte
7
29%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
0
Frei
2
Entwickler 2
Bewertung
(4)
Projekte
4
0%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
25%
Frei
3
Entwickler 3
Bewertung
(6)
Projekte
7
0%
Schlichtung
0
Frist nicht eingehalten
5
71%
Frei
4
Entwickler 4
Bewertung
(1)
Projekte
2
0%
Schlichtung
0
Frist nicht eingehalten
1
50%
Frei
5
Entwickler 5
Bewertung
(82)
Projekte
86
57%
Schlichtung
25
0% / 84%
Frist nicht eingehalten
19
22%
Frei
6
Entwickler 6
Bewertung
(62)
Projekte
140
46%
Schlichtung
19
42% / 16%
Frist nicht eingehalten
32
23%
Frei
7
Entwickler 7
Bewertung
(7)
Projekte
13
0%
Schlichtung
5
20% / 60%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange and forex market. I already have some source code to a strategy but would like to enhance it to make it profitable and automated
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link

Projektdetails

Budget
30 - 50 USD
MwSt (18%): 5.4 - 9 USD
Insgesamt: 35.4 - 59 USD
Für die Entwickler
27 - 45 USD
Ausführungsfristen
von 1 bis 10 Tag(e)