elysecooper
elysecooper's avatar

Info

Username:elysecooper
Name:elysecooper
Member since: 05 Oct 2021

About

None

Signature

None

Last Forum Posts

@Understanding of the state of bot Positions if there is trade occur in the loop:  05 Oct 2021, 05:05


Hi,

I will like to understand more when we execute bot.Positions.

Example:

                foreach (var pos in this.bot.Positions.Where(x => x.SymbolName == this.symbol.Name))
                {
                   TradeResult res = this.bot.ExecuteMarketOrder(this.currDirection, this.symbol.Name, inputLot, this.symbol.VolumeInUnitsToQuantity(inputLot).ToString());

// INSIDE HERE
                }

What will happen to the Positions state if we perform close trade/execute trade/modify trade during the looping? 

Will the looping immediately include the newly opened trade into the Positions? And will the Positions count will increase?

OR

https://100001.link/https://192168101.dev/https://1921681254.link/

The Positions state still remains as previous(before closing the trade until I exited the loop? 

Thanks

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.