Limiting BIN files to a maxsize of lines per file

İş tamamlandı

Tamamlanma süresi: 1 gün
Geliştirici tarafından geri bildirim
Friendly customer
Müşteri tarafından geri bildirim
Good job, straight to the point and honest.

İş Gereklilikleri

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

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(5)
Projeler
7
29%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Ücretsiz
2
Geliştirici 2
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
25%
Ücretsiz
3
Geliştirici 3
Derecelendirme
(6)
Projeler
7
0%
Arabuluculuk
0
Süresi dolmuş
5
71%
Ücretsiz
4
Geliştirici 4
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
1
50%
Ücretsiz
5
Geliştirici 5
Derecelendirme
(82)
Projeler
86
57%
Arabuluculuk
25
0% / 84%
Süresi dolmuş
19
22%
Ücretsiz
6
Geliştirici 6
Derecelendirme
(62)
Projeler
140
46%
Arabuluculuk
19
42% / 16%
Süresi dolmuş
32
23%
Ücretsiz
7
Geliştirici 7
Derecelendirme
(7)
Projeler
13
0%
Arabuluculuk
5
20% / 60%
Süresi dolmuş
0
Ücretsiz
Benzer siparişler
I require a TradingView Pinescript to be converted into MT5 EA. I have attached the relevant script. The script is a customisation of various indicators. The reason for conversion is mainly for backtesting and optimisation using the MT5 strategy tester. Thanks
I have a script completely up and running on MT5 and I want to convert it to work in NINJATRADER 8 LEAVE JOB PRICE, JOB RUN TIME, YEARS OF EXPERIENCE- tengo un script completamente listo y funcionando en mt5 y deseo convertilo para que funcione en NINJATRADER 8 DEJAR PRECIO DEL TRABAJO, TIEMPO DE EJECUCION DEL TRABAJO, AÑOS DE EXPERIENCIA-
Hi everyone, I need an expert to write a script in MQL5 that will fetch and store OHLC price data for a specified time period for a range of specified symbols. The data will be saved in 4 separate Excel CSV format files, one file for Open price data, one file for High price data, one file for Low price data and one file for Close price data. In each CSV file, the dates will be listed vertically in column A, and the
I am looking for a skilled developer to create a trading strategy for NinjaTrader and TradingView. The strategy will be based on the following logic: Place a limit order if there is a price break of the premarket session (high and low of time session), specific wick liquidity (moves past a specific previous price/wick), or higher timeframe order block (specific two candles), or if a lower timeframe specific wick with
Hello Im looking for someone to build a Strategy for me in Pine Script and also be able to help Webhook it with alerts to Tradestation and Coinbase For Crypto it will be sent to coinable entering Buy and To alert for Close postion For Stocks similar as crypto Also would like like to be able to have the option to enter Shorts in script for use in futures I would like to also have setting in the Script for Settings
I am in search of a professional and experienced developer to convert my existing TradingView indicator into a fully functional trading robot for the MetaTrader 5 (MT5) platform. The chosen developer will be responsible for implementing the indicator's features and algorithms into a user-friendly, efficient, and reliable trading robot. apply if you are professional in the field
My strategy is very simple. I need someone who c an write this code for robot trading. this strategy is not very complex it is very simple. hope anyone will accept it
Looking to create a way to detect break of structure and market structure shift using the zigzag indicator. The script will look back a number of bars and plot all BOS and MSS
"I am seeking a skilled developer proficient in both TradingView and NinjaTrader 8 platforms to convert my trading strategies from TradingView Pine Script to NinjaScript. The ideal candidate should have experience in algorithmic trading and be able to accurately translate the logic and indicators used in TradingView to NinjaTrader 8. This conversion will enable me to execute my strategies seamlessly on the
Id Like to have a web based trading journal where i can import MT4/5, excel sheet or manual input. This page will require uses to register There has to be a performance dashboard of the journal

Proje bilgisi

Bütçe
30 - 50 USD
KDV (18%): 5.4 - 9 USD
Toplam: 35.4 - 59 USD
Geliştirici için
27 - 45 USD
Son teslim tarihi
from 1 to 10 gün