I wrote an EA using a custom indicator in ex4 - mql4

I wrote an EA using a custom indicator in ex4 format, everything is working. but I notice that after the strategy tester finished back testing, the screen will be white with many lines, as a result I can't see the chart, I will like to analyse if the trade is executed according to the code.

Related

CarRacing-v0 in Gym: The screen is totally black when I run the environment

I'm trying to run one of the gym environments, CarRacing, with the code from (https://gist.github.com/lmclupr/b35c89b2f8f81b443166e88b787b03ab) modified to work with the current versions of Keras etc.
And it works: that is, it starts training and, if I put a print in "action", I can see what actions it is taking at each moment.
However, the display is not as it should be (see https://www.youtube.com/watch?v=pTYOyl8To7g), but I get a big screen that is totally black, and a smaller one where the black bar moves as if it wanted to show something.
Do you know what it could be? Is this a typical problem of gym, or cv...?
PS: I don't know how it is usually done in Stack to share a more or less long code (approx. 250 lines). Tell me if necessary.
See link below
TDLR add env.render("human") to your code
https://github.com/openai/gym/issues/492

Use image library from Hammerspoon

I'd like to use a more sophisticated graphics or GUI widget library in my Hammerspoon config file, in order to get user input and do more advanced drawing on the screen than Hammerspoon allows (as far as I can tell) by default. I'm new to Lua and Hammerspoon, and so far I've been unable to figure out how to get this working. (Simple drawing on-screen is not a problem, so examples of geometric shapes are not helpful. I can do that already with no difficulty.)
I initially thought one of the Lua libraries designed for building games would have more than I could possibly need, and looked into love2d, but it did not appear to be possible to use with Hammerspoon in any straightforward manner.
To give two concrete examples of things I'd like to do:
I'd like to display a dialog box in which the user can enter two values, to specify how many rows and how many columns they want in their screen grid. A native Cocoa dialog would be better, but something graphically drawn on screen with Lua would be fine, as long as the details of the image are abstracted away for me, and I can just define the text and fields and buttons in the dialog.
I'd like to draw a dotted-line rectangle with curved corners and a shadow around specified grid segments as a preview of where a window would be moved if the user completed a certain command.
There's a lot more, but anything that allows me to do those things should allow me to do anything else I want.
We don't yet have a good answer to generating dialog boxes, although it is possible to do it with AppleScript, which you can call from Hammerspoon with hs.osascript.
As for drawing things like dotted-line rectangles, we can't currently do that, but if you'd like to file an issue on our GitHub project, it's something we can look at for a future release :)

Apple's SpeedSketch example app is very laggy

I want to create an app which uses the Apple Pencil (or just a finger) to draw/sketch/write on a blank "sheet" on the iPad. Last WWDC there was a session which shows how the Apple Pencil should be used inside an app.
Here's a link to this session: https://developer.apple.com/videos/play/wwdc2016/220/
(You can download the example app there.)
When you start to draw something it works really great. But after a while, if you have drawn a lot, it gets really laggy and I don't know why. I want to use this code inside my app to be able to use the pencil, but I can't use it like that, because it get's really annoying when you want to draw something and it takes some time until the line is showing up.
There is the following comment in CGDrawingEngine.swift:
/**
Note: this is not a particularily efficient way to draw a great stroke path
with CoreGraphics. It is just a way to produce an interesting looking result.
For a real world example you would reuse and cache CGPaths and draw longer
paths instead of an aweful lot of tiny ones, etc. You would also respect the
draw rect to cull your draw requests. And you would use bezier paths to
interpolate between the points to get a smooother curve.
*/
It would be very nice if you could try to understand what's exactly happening and why it is very slow after some time and how to change the code according to Apple's comment on the drawing function.
(PS: I should mention that this example app is only running on iOS10 Beta with Swift 3.0)
EDIT: I'm testing this app on an iPad Pro (12.9") with iOS10 Beta 5.

Sparx Enterprise Architect - Hyperlink to a specific area of a large diagram

I am trying to build a simplified EA from 'top to bottom', what I mean is I have a large diagram which has multiple objects, mainly ERDs Entities. I also have more and more detailed diagrams and can successfully drill down by hyperlinking to the next level down.
I have even setup a hyperlink on each of the lower level diagrams to go back to the previous.
So far, so good. When I publish as HTML, I get a really useful web tree that pretty much does what I want, except for one thing!
Each of the lower diagrams are reasonably small, so when I drill back up, I am happy with being positioned at the top left of the previous diagram (with me so far?).
When I drill back up to the primary diagram, I get returned to the top left.
BUT - as this primary diagram prints out on 12 A3 pages, it would be really good to be able to return to the area of the primary diagram that refers to the diagram that I just clicked into/out-of.
I am no deep HTML expert, but I know there is methods in HTML to hyperlink to a specific part of a page. Can anyone think of a way to tweak the returning hyperlink to position me at a specific point in the primary diagram?
PHEW
Thanks, PGB
To my knowledge there is no way to achieve this using EA's hyperlinks. EA does not use HTML internally, and an EA diagram hyperlink has no space for offset or zoom level, it simply opens the diagram.
Normally I would say that if you want an element to do something like this you can code it up yourself in an Add-In, but I'm pretty sure you can't specify pan/zoom when opening a diagram in the API either.
So I'm afraid this is one of those rare occasions where the answer is "you're doing it wrong." Adding all information everywhere is a sure-fire way of ending up with a model that's both impossible to navigate and a nightmare to maintain.
To build a better model you should work with abstractions and/or aspects (hard to say which is the better route forward without doing an actual architectural analysis).
What I do is to create sub-domain diagrams and then drag those onto an overview diagram. They scale down to nearly iconic size but still give an idea of the contents. Now I use large text to explain those sub-domains. This can usually fit to some A3-size (A2 if you like to show off). But from this overview you can easily focus to the single sub-domains by double-clicking the diagram frames.

Pixel-perfect acceptance testing on iOS

I'm given exact size .png renders from Application Design showing exactly what my app should look like on Retina 4", Retina 3.5", etc.
Would like to automate a comparison between these "golden master" renders and screenshots of what the app actually looks like when that screen is shown.
Ideally I would like to have something I can run via continuous integration so I can break the build if a .xib gets messed up.
How can I do this?
Already tried:
Used Command-S in iPhone simulator to grab a screenshot suitable for comparison
Used GitHub's excellent image diff interface to manually compare the images
Pulled them up side-by-side in Preview.app, in actual size (Command-0)
Did some research on ImageMagick's comparison capabilities (examples)
Possible approaches:
Getting a screenshot of the app in code is already implemented
Similarly, I'm pretty sure I can find code to simulate a tap on the screen
Might need some way to exclude a mask or bounding box of areas known to not match exactly
Take a look at ios-snapshot-test-case, which was built for something close to this.
It will take a reference image the first time a test is run and then compare subsequent test outputs to the reference image. You could essentially use this but instead of creating reference images from the tests, you supply your own reference images.
In practice, this will be extremely tricky to do correctly. There are subtle differences in how text, gradients, etc are rendered between iOS and whatever tool your designers are using.
I'd check out KIF for functional testing.
You can create a custom test (small example near the end of the readme just above "Use with other testing frameworks") that takes a screenshot and compares it to your expected screenshot for that view. Just call failWithException:stopTest: if it doesn't match.
As you mentioned, you will want to save a mask with each expected screenshot, and apply the mask before comparing. You will always have parts of the screen that won't match, like the time in the status bar at a minimum.
For the comparison itself, here are a couple links:
Building an image mask
Slow, straightforward way to compare two images
OpenCV: I've seen this recommended, but haven't tried it.
I know this is an older question, but it's worth pointing out that KIF has built a "Perceptual Difference Testing Framework" called Lela:
https://github.com/kif-framework/Lela
If you're already using KIF this is the way to go. I believe it uses somewhat fuzzy image diffing so it may be able to get around the text rendering issues David Grandinetti mentioned. I haven't tried using it against external comps though.
If you're more comfortable with BDD/Cucumber/Gherkin syntax, you should also check out Zucchini, which uses reference images:
http://zucchiniframework.org/
I haven't used it but it's well spoken of.
I suggest you take a look at Visual CI
It's a software built for Continuous integration image compare,
It has UI that allows you to control settings which also include which parts of your image to compare
It's kind of new, but may answer your requirements better.

Resources