It's hard to tell what the problem is with just some samples of the code. You should share the complete cBot code so that we can reproduce the problem.
Best regards,
Panagiotis
also, to replicate.. you need to place some trades, then choose your checkbox options then “Move Stoploss”
Thanks
Hi there,
I tried for a while to reproduce it but with no luck. Can you provide more specific steps we need to follow to reproduce this?
Best regards,
Panagiotis
Hey Panagoitis, thanks for going to this effort. Simplest reproduction is
Step 1) Place a trade
Step 2) Click the “Close selected trades” button, Feel free to toggle any of the checkboxes, results are the same.
Step 3) See "Crashed in Click event with NullReferenceException: Object reference not set to an instance of an object.
Thanks!
Hi there,
Unfortunately the code you have shared has less parameters and displays nothing on the chart. So we are probably not running the same code
Best regards,
Panagiotis
not sure i follow, what i've got here is the same with some unrelated changes.. but i'll repost the full current version, there's the updated version used to create the error with “Close selected trades” button on the above images: > https://gist.github.com/glenndavy/1e15326378b01bd43deb9fe171d55564
It's hard to tell what the problem is with just some samples of the code. You should share the complete cBot code so that we can reproduce the problem.
Best regards,
Panagiotis
also, to replicate.. you need to place some trades, then choose your checkbox options then “Move Stoploss”
Thanks
Hi there,
I tried for a while to reproduce it but with no luck. Can you provide more specific steps we need to follow to reproduce this?
Best regards,
Panagiotis
Hey Panagoitis, thanks for going to this effort. Simplest reproduction is
Step 1) Place a trade
Step 2) Click the “Close selected trades” button, Feel free to toggle any of the checkboxes, results are the same.
Step 3) See "Crashed in Click event with NullReferenceException: Object reference not set to an instance of an object.
Thanks!
Hi there,
Unfortunately the code you have shared has less parameters and displays nothing on the chart. So we are probably not running the same code
Best regards,
Panagiotis
not sure i follow, what i've got here is the same with some unrelated changes.. but i'll repost the full current version, there's the updated version used to create the error with “Close selected trades” button on the above images: > https://gist.github.com/glenndavy/1e15326378b01bd43deb9fe171d55564
It's hard to tell what the problem is with just some samples of the code. You should share the complete cBot code so that we can reproduce the problem.
Best regards,
Panagiotis
also, to replicate.. you need to place some trades, then choose your checkbox options then “Move Stoploss”
Thanks
Hi there,
I tried for a while to reproduce it but with no luck. Can you provide more specific steps we need to follow to reproduce this?
Best regards,
Panagiotis
Hey Panagoitis, thanks for going to this effort. Simplest reproduction is
Step 1) Place a trade
Step 2) Click the “Close selected trades” button, Feel free to toggle any of the checkboxes, results are the same.
Step 3) See "Crashed in Click event with NullReferenceException: Object reference not set to an instance of an object.
It's hard to tell what the problem is with just some samples of the code. You should share the complete cBot code so that we can reproduce the problem.
Best regards,
Panagiotis
also, to replicate.. you need to place some trades, then choose your checkbox options then “Move Stoploss”
It's hard to tell what the problem is with just some samples of the code. You should share the complete cBot code so that we can reproduce the problem.
Best regards,
Panagiotis
THanks Panagiotis, really appreciate that.. it was to big to paste here, but here's a link. I think its line 368 that hits the error. pls excuse the coding, its my first c# effort
Should this line return null if the horizontal line named “Insight” can't be found and set the value of insightLine to null?:
Yes
Should I expect that insightLine.IsAlive should now be False? (but insightLine is ≠ null)
Yes
insightLine should now be null?
Yes
What I get is, that remove object doesn't seem to change the IsAlive property to false, and once it exists FindObject never seems to return a null, mostly as established with DrawStaticText, but I thought I should clarify whats actually expected behaviour.
Works fine for me. See my code below
using System;using System.Collections.Generic;using System.Linq;using System.Text;using cAlgo.API;using cAlgo.API.Collections;using cAlgo.API.Indicators;using cAlgo.API.Internals;namespace cAlgo{ [Indicator(AccessRights = AccessRights.None, IsOverlay = true)] public class NewIndicator : Indicator { [Parameter(DefaultValue = "Hello world!")] public string Message { get; set; } [Output("Main")] public IndicatorDataSeries Result { get; set; } ChartHorizontalLine insightLine; protected override void Initialize() { insightLine = Chart.DrawHorizontalLine("Insight", 1, Color.Red); insightLine = Chart.FindObject("Insight") as ChartHorizontalLine; Print(insightLine.IsAlive); Chart.RemoveObject("Insight"); Print(insightLine.IsAlive); } public override void Calculate(int index) { } }}
Best regards,
Panagiotis
Awesome, thanks Panagiotis, now I know what should happen… :)
This website uses cookies to enhance site navigation, analyze site usage, and assist in our marketing efforts. By clicking “Accept All” you are providing your consent to our use of all cookies. Alternatively, please provide your choice by pressing “Customize Cookies”. For more information, please read our Privacy policy
ctid4921325
07 Feb 2024, 02:24
Hi there
I'm using a broker who has 2 versions of each pair, for eg USDJPY and USDJPY.p
I have a bot which uses `Symbol.PipSize` to calculate various things.
On the USDJPY.p symbol however locks up the bot when I reference its ‘Symbol.PipSize' .
How can I manage this?
Thanks
@ctid4921325