Limiting BIN files to a maxsize of lines per file

MQL4 전문가 스크립트

작업 종료됨

실행 시간 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
무료
비슷한 주문
Looking for EA's that can pass prop firms Only message me if you are serious thank you https://t.me/ marketkillerrr Message me on tele^Gram thanks Or you can msg me here it doesn't matter please do not waste my time... Price is negotiable i can pay up to 30,000$
I hope this message finds you well. I am in search of a skilled developer to transform three indicators into a fully functional trading robot. These indicators consist of two MACD indicators, each displaying two colors (red and green), along with an arrow signal. Here are the specific requirements for the project: The robot should execute trades only when the arrow signal appears and both MACD indicators are
An expert is required based on a specific index of the market The expert does the following Opens 0.01 micro lot per $1000 A buy trade is opened if the indicator signal is buy and can be entered against the signal A sell trade is opened if the indicator signal is sell and can be entered against the signal A goal defined by the number of points Stop loss is limited to the number of pips Profit tracking Stop loss
News field 30+ USD
I am in need of a custom EA news filter for my trading platform, and I believe your expertise in this field can greatly assist me. Below are the specifications for the filter: 1. It should be implemented as a boolean function, returning either true or false. 2. The filter must automatically detect currency pairs. 3. Three hours before and after any significant news events pertaining to each currency in the pair, the
Hello .I have existing Tradingview strategy that I will like to automate to Mt4 EA based on my specification . I need an expert in the field that have experience in both tradingview and MT4
I Want someone who can Create a Mobile EA Automatic Trading Bot system with My kind of trading style (BTMM) Beat The makert maker,which includes a bit of mixed strategies such as Smart money concept(SMC) and Market Maker Cycle(MMC),The Bot must be Able to Take short and long term trades only after Rejections/confirmations not when it's going against(to minimize/avoid blowing small Accounts),it must place Stoploss and
Hey I trust my request finds you well ❤️I need a well experienced MQL4 programmer who can pay attention to details and come up with ideas perfectly suited the needed based on my needs for trading mt4, reach out to collaborate now
Coder needed 30 - 45 USD
Hello, I am a trader and I trade on MT4/5 platform , but now I want to upgrade my trading so I need an expert who can code an Expert advisor EA for me with my strategy on MT4/MT5, so if you are an expert in coding I am expecting your response
Hi, Coding Skills Required: Experience in coding trading robots for MT5. Ability to implement increasing coefficients for the distance between orders and lot size 1. Project Objective: Develop an automated trading robot for MetaTrader 5 (MT5) as per the specified trading strategy. 2. Trading Strategy: The robot must execute a strategy that includes the following elements: Opening initial orders. Placing pending
my style of trade is to manually scale position size up & down from 1 to 100+ micros as the market moves, so the indicator I need has nothing to do with scaling in & out of the position, but I need an indicator that dynamically trails the position P&L, And has a trailing daily max loss that will reject new order entry if triggered. Example is setting a $350 Position auto stop-loss so as I scale in & out of contracts

프로젝트 정보

예산
30 - 50 USD
VAT (18%): 5.4 - 9 USD
총: 35.4 - 59 USD
개발자에게
27 - 45 USD
기한
에서 1  10 일