Forum

how can i write bid and ask every time it change into a csv file. because by my code it only write first 1 only

int file_handle = FileOpen (InpFileName, FILE_READ | FILE_WRITE | FILE_CSV ); datetime curr = TimeCurrent (); if (file_handle!= INVALID_HANDLE ){ if (curr >= 0 ){ FileWrite (file_handle,curr,spread,Ask,Bid,ask_bid_diff);

How can I make my EA not to pass my sl

When am using my EA on crash1000 and I opened a buy position, the ea will not stop at stop loss if there is rapid bearish candle, it passes sl and closes down sl by far. Which code can I use to make sure that my EA stop at sl and not pass because even if i use position close below sl or does not

can someone assist me in making a function which trade only once per candle not at the start of candle but through out candle until condition is met.

bool Tradeallowed(){ bool hastraded = false ; for ( int a = PositionsTotal ()- 1 ;a>= 0 ;a--){ string symbol1 = PositionGetSymbol (a); if ( Symbol () == symbol1){ ulong pticket1 = PositionGetTicket (a); double

Function which allow 1 trade per candle not at beginning of candle only

How can I make a function that only allow 1 trade or open position per candle not only at the beginning of the candle but until new candle forms. The newbar function only allows at beginning of new candle only

if am using two MA indicator for buy and sell.

if am using two MA indicator for buy and sell, if a buy condition is met the EA does not stop opening order on the buy condition even after tp or sl has been hit and i want it to only open once (1) everytime the condition is met